3 . git-sh-setup || die
"Not a git archive"
6 echo >&2 "usage: $(basename $0)"' [<branchname> [start-point]]
8 If no arguments, show available branches and mark current branch with a star.
9 If one argument, create a new branch <branchname> based off of current HEAD.
10 If two arguments, create a new branch <branchname> based off of <start-point>.
17 headref
=$
(readlink
"$GIT_DIR/HEAD" |
sed -e 's|^refs/heads/||')
18 git-rev-parse
--symbolic --all |
19 sed -ne 's|^refs/heads/||p' |
23 if test "$headref" = "$ref"
44 rev=$
(git-rev-parse
--verify "$head") ||
exit
46 [ -e "$GIT_DIR/refs/heads/$branchname" ] && die
"$branchname already exists"
48 echo $rev > "$GIT_DIR/refs/heads/$branchname"