Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-branch.sh2
-rwxr-xr-xgit-checkout.sh4
2 files changed, 5 insertions, 1 deletions
diff --git a/git-branch.sh b/git-branch.sh
index e2db9063d4..67f113acb9 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -102,4 +102,6 @@ rev=$(git-rev-parse --verify "$head") || exit
git-check-ref-format "heads/$branchname" ||
die "we do not like '$branchname' as a branch name."
+leading=`expr "refs/heads/$branchname" : '\(.*\)/'` &&
+mkdir -p "$GIT_DIR/$leading" &&
echo $rev > "$GIT_DIR/refs/heads/$branchname"
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" ] &&