termie/git-bzr-ng — Issue #33: git-bzr do not support using "/" in branch name
Author: baby-gnu
Created: 2011-12-01 11:05:27+00:00
State: open

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