]> git.ipfire.org Git - thirdparty/git.git/blame - git-branch-script
[PATCH] Updates for cvs-migration.txt
[thirdparty/git.git] / git-branch-script
CommitLineData
37f1a519
LT
1#!/bin/sh
2
3. git-sh-setup-script || die "Not a git archive"
4
5branchname="$1"
a38e7279
JH
6case "$2" in
7'')
8 head=HEAD ;;
9*)
10 head="$2^0" ;;
11esac
12rev=$(git-rev-parse --revs-only --verify "$head") || exit
37f1a519
LT
13
14[ -z "$branchname" ] && die "git branch: I want a branch name"
15[ -e "$GIT_DIR/refs/heads/$branchname" ] && die "$branchname already exists"
16
17echo $rev > "$GIT_DIR/refs/heads/$branchname"