diff options
| author | Junio C Hamano <junkio@cox.net> | 2005-12-03 23:46:02 -0800 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2005-12-03 23:46:02 -0800 |
| commit | 423325a2d24638ddcc82ce47be5e40be550f4507 (patch) | |
| tree | 00960b001d786299d3da04a4467bd0c798bf8cda /git-branch.sh | |
| parent | GIT 0.99.9k (diff) | |
| parent | [PATCH] daemon.c and path.enter_repo(): revamp path validation. (diff) | |
| download | git-1.0rc4.tar.gz git-1.0rc4.zip | |
Diffstat (limited to 'git-branch.sh')
| -rwxr-xr-x | git-branch.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/git-branch.sh b/git-branch.sh index 4cd5da16f7..5306b2719f 100755 --- a/git-branch.sh +++ b/git-branch.sh @@ -1,6 +1,11 @@ #!/bin/sh -. git-sh-setup +GIT_DIR=`git-rev-parse --git-dir` || exit $? + +die () { + echo >&2 "$*" + exit 1 +} usage () { echo >&2 "usage: $(basename $0)"' [-d <branch>] | [[-f] <branch> [start-point]] @@ -12,8 +17,7 @@ If two arguments, create a new branch <branchname> based off of <start-point>. exit 1 } -headref=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD | - sed -e 's|^refs/heads/||') +headref=$(git-symbolic-ref HEAD | sed -e 's|^refs/heads/||') delete_branch () { option="$1" @@ -114,4 +118,3 @@ then fi fi git update-ref "refs/heads/$branchname" $rev - |
