]> git.ipfire.org Git - thirdparty/git.git/blame - git-branch-script
git-fetch-pack: close output fd after dup'ing the input
[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"
6rev=$(git-rev-parse --verify --default HEAD "$2"^0) || exit
7
8[ -z "$branchname" ] && die "git branch: I want a branch name"
9[ -e "$GIT_DIR/refs/heads/$branchname" ] && die "$branchname already exists"
10
11echo $rev > "$GIT_DIR/refs/heads/$branchname"