Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-bzr do not support using "/" in branch name #33

Open
baby-gnu opened this issue Dec 1, 2011 · 1 comment · May be fixed by #63
Open

git-bzr do not support using "/" in branch name #33

baby-gnu opened this issue Dec 1, 2011 · 1 comment · May be fixed by #63

Comments

@baby-gnu
Copy link

baby-gnu commented Dec 1, 2011

This is a git convention, as branch names are juste files under .git/refs/heads, every parts before last element must be a directory.

I implement a fix to create the parent directories as needed.

Regards.

git pull git://git.baby-gnu.net/git-bzr-ng dad/fix-git-style-branch-name-with-slashes

Subject: [PATCH] git-bzr do not support using "/" in branch name.

* git-bzr (cmd_import): Create parent directories of the bzr branch.

---
 git-bzr |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/git-bzr b/git-bzr
index 327d935..ff204f8 100755
--- a/git-bzr
+++ b/git-bzr
@@ -579,6 +579,10 @@ def cmd_import(args):
   if branch_exists(bzr_ref):
     die('Branch already exists: %s', bzr_ref)
 
+  # Permit git-style branch name with / in them
+  if not os.path.isdir(os.path.dirname(cl.bzr_dir(branch))):
+    os.makedirs(os.path.dirname(cl.bzr_dir(branch)))
+
   # Do the actual bzr fetch
   bzr(['branch', url, cl.bzr_dir(branch)])
 
-- 
1.7.7.3
@baby-gnu baby-gnu linked a pull request Jan 2, 2014 that will close this issue
@christofferholmstedt
Copy link

I just hit this when trying to push a branch with / in it. Didn't really understand the problem...now I do. I hit the problem when doing the following thing:

git checkout -b feature/new_awesome_feature
git bzr push lp:~<user>/<project>/<branch_with_forward_slash>

and got the following error:

bzr: ERROR: Parent of "<branch>" does not exist.
ERROR:root:Command "bzr branch <master> <branch>" failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants