summaryrefslogtreecommitdiff
path: root/git-branch.sh
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2005-11-14 23:10:59 +0100
committerJunio C Hamano <junkio@cox.net>2005-11-14 17:15:32 -0800
commit08db81a9f1e4072790f0257f5398e8408e3d6816 (patch)
tree918b707153ab79e498576de81fb9b89bc07ac7ac /git-branch.sh
parent7acab8f16785151f9b6d9bbd8a9b0a8b76b26fba (diff)
downloadgit-08db81a9f1e4072790f0257f5398e8408e3d6816.tar.gz
allow git-update-ref create refs with slashes in names
Make git-update-ref create references with slashes in them. git-branch and git-checkout already support such reference names. git-branch can use git-update-ref to create the references in a more formal manner now. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-branch.sh')
-rwxr-xr-xgit-branch.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/git-branch.sh b/git-branch.sh
index 67f113acb9..11d52fd78e 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -102,6 +102,5 @@ 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"
+git update-ref "refs/heads/$branchname" $rev
+