diff options
author | Junio C Hamano <junio@twinsun.com> | 2005-09-30 14:26:57 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-10-01 23:19:33 -0700 |
commit | 8098a178b26dc7a158d129a092a5b78da6d12b72 (patch) | |
tree | a91aec067dd33319e2f33de565c42ef43b449b56 /git-bisect.sh | |
parent | a876ed83be5467d6075da8a16306724cb1babc2a (diff) | |
download | git-8098a178b26dc7a158d129a092a5b78da6d12b72.tar.gz |
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-bisect.sh')
-rwxr-xr-x | git-bisect.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/git-bisect.sh b/git-bisect.sh index 8dc77c991c..1ab2f187dc 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -38,7 +38,8 @@ bisect_start() { # Verify HEAD. If we were bisecting before this, reset to the # top-of-line master first! # - head=$(readlink $GIT_DIR/HEAD) || die "Bad HEAD - I need a symlink" + head=$(GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD) || + die "Bad HEAD - I need a symbolic ref" case "$head" in refs/heads/bisect*) git checkout master || exit @@ -46,7 +47,7 @@ bisect_start() { refs/heads/*) ;; *) - die "Bad HEAD - strange symlink" + die "Bad HEAD - strange symbolic ref" ;; esac @@ -135,7 +136,7 @@ bisect_next() { echo "$rev" > "$GIT_DIR/refs/heads/new-bisect" git checkout new-bisect || exit mv "$GIT_DIR/refs/heads/new-bisect" "$GIT_DIR/refs/heads/bisect" && - ln -sf refs/heads/bisect "$GIT_DIR/HEAD" + GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD refs/heads/bisect git-show-branch "$rev" } |