From: Junio C Hamano Date: Mon, 28 Nov 2005 07:16:15 +0000 (-0800) Subject: branch: make it operable from a subdirectory. X-Git-Tag: v0.99.9l^2~23^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9cc2527cd2943c82cf448dccec564869b0a762e6;p=git.git branch: make it operable from a subdirectory. Signed-off-by: Junio C Hamano --- diff --git a/git-branch.sh b/git-branch.sh index 4cd5da16f..b48c32988 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 ] | [[-f] [start-point]] @@ -12,8 +12,7 @@ If two arguments, create a new branch based off of . 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 -