summaryrefslogtreecommitdiff
path: root/git-branch.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-12-14 13:01:01 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2005-12-14 13:01:01 -0800
commitb0d3e9baaa16c805ef941e8f26d55fb23f091ef5 (patch)
tree142e8fb76c906de7b61b9bf55ab026bee2388aa3 /git-branch.sh
parentDocumentation: topic branches (diff)
parentapplypatch: no need to do non-portable [[ ... ]] (diff)
downloadtgif-b0d3e9baaa16c805ef941e8f26d55fb23f091ef5.tar.xz
Merge branch 'fk/usage'
Diffstat (limited to 'git-branch.sh')
-rwxr-xr-xgit-branch.sh21
1 files changed, 6 insertions, 15 deletions
diff --git a/git-branch.sh b/git-branch.sh
index 5306b2719f..0266f46223 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -1,21 +1,12 @@
#!/bin/sh
-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]]
-
-If no arguments, show available branches and mark current branch with a star.
+USAGE='[-d <branch>] | [[-f] <branch> [start-point]]'
+LONG_USAGE='If no arguments, show available branches and mark current branch with a star.
If one argument, create a new branch <branchname> based off of current HEAD.
-If two arguments, create a new branch <branchname> based off of <start-point>.
-'
- exit 1
-}
+If two arguments, create a new branch <branchname> based off of <start-point>.'
+
+SUBDIRECTORY_OK='Yes'
+. git-sh-setup
headref=$(git-symbolic-ref HEAD | sed -e 's|^refs/heads/||')