summaryrefslogtreecommitdiff
path: root/git-status.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junio@twinsun.com>2005-09-30 21:26:57 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-02 06:19:33 (GMT)
commit8098a178b26dc7a158d129a092a5b78da6d12b72 (patch)
treea91aec067dd33319e2f33de565c42ef43b449b56 /git-status.sh
parenta876ed83be5467d6075da8a16306724cb1babc2a (diff)
downloadgit-8098a178b26dc7a158d129a092a5b78da6d12b72.zip
git-8098a178b26dc7a158d129a092a5b78da6d12b72.tar.gz
git-8098a178b26dc7a158d129a092a5b78da6d12b72.tar.bz2
Add git-symbolic-ref
This adds the counterpart of git-update-ref that lets you read and create "symbolic refs". By default it uses a symbolic link to represent ".git/HEAD -> refs/heads/master", but it can be compiled to use the textfile symbolic ref. The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah .git/HEAD' have been converted to use new git-symbolic-ref command, so that they can deal with either implementation. Signed-off-by: Junio C Hamano <junio@twinsun.com>
Diffstat (limited to 'git-status.sh')
-rwxr-xr-xgit-status.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-status.sh b/git-status.sh
index 621fa49..ca9a154 100755
--- a/git-status.sh
+++ b/git-status.sh
@@ -31,7 +31,7 @@ report () {
[ "$header" ]
}
-branch=`readlink "$GIT_DIR/HEAD"`
+branch=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD)
case "$branch" in
refs/heads/master) ;;
*) echo "# On branch $branch" ;;
@@ -39,7 +39,7 @@ esac
git-update-index --refresh >/dev/null 2>&1
-if test -f "$GIT_DIR/HEAD"
+if GIT_DIR="$GIT_DIR" git-rev-parse --verify HEAD >/dev/null 2>&1
then
git-diff-index -M --cached HEAD |
sed 's/^://' |