Skip to content

Commit

Permalink
branch: make it operable from a subdirectory.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 29, 2005
1 parent 1abacf3 commit 9cc2527
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions git-branch.sh
Original file line number Diff line number Diff line change
@@ -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]]
Expand All @@ -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"
Expand Down Expand Up @@ -114,4 +113,3 @@ then
fi
fi
git update-ref "refs/heads/$branchname" $rev

0 comments on commit 9cc2527

Please sign in to comment.