Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-28 10:16:15 +0300
committerJunio C Hamano <junkio@cox.net>2005-11-29 10:13:03 +0300
commit9cc2527cd2943c82cf448dccec564869b0a762e6 (patch)
treeef8705d01a361a9999807a3ff8e4516294ffcc80 /git-branch.sh
parent1abacf3b5b53f6cde7148862234d451cd88d0de3 (diff)
branch: make it operable from a subdirectory.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-branch.sh')
-rwxr-xr-xgit-branch.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/git-branch.sh b/git-branch.sh
index 4cd5da16f7..b48c32988f 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-. git-sh-setup
+GIT_DIR=`git-rev-parse --git-dir` || exit $?
usage () {
echo >&2 "usage: $(basename $0)"' [-d <branch>] | [[-f] <branch> [start-point]]
@@ -12,8 +12,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 +113,3 @@ then
fi
fi
git update-ref "refs/heads/$branchname" $rev
-