diff options
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-x | git-checkout.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/git-checkout.sh b/git-checkout.sh index cb33fdc7e2..4c08f36b59 100755 --- a/git-checkout.sh +++ b/git-checkout.sh @@ -126,7 +126,9 @@ fi # if [ "$?" -eq 0 ]; then if [ "$newbranch" ]; then - echo $new > "$GIT_DIR/refs/heads/$newbranch" + leading=`expr "refs/heads/$newbranch" : '\(.*\)/'` && + mkdir -p "$GIT_DIR/$leading" && + echo $new >"$GIT_DIR/refs/heads/$newbranch" || exit branch="$newbranch" fi [ "$branch" ] && |