1#!/bin/sh
23
. git-sh-setup-script || die "Not a git archive"
45
branchname="$1"
6rev=$(git-rev-parse --verify --default HEAD "$2"^0) || exit
78
[ -z "$branchname" ] && die "git branch: I want a branch name"
9[ -e "$GIT_DIR/refs/heads/$branchname" ] && die "$branchname already exists"
1011
echo $rev > "$GIT_DIR/refs/heads/$branchname"