aboutsummaryrefslogtreecommitdiff
path: root/git-branch.sh
diff options
context:
space:
mode:
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 5306b2719..0266f4622 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/||')