X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-bisect.sh;h=d92993b94e4264d9c13547f8bc3a1d9c6c77017a;hb=10637b84d91cf8870d1db8609a10dc5e58722378;hp=8dc77c991c0e8c5a618383052306f9ef1a018352;hpb=8ac93bc98f5e868e890e1a740df9f0c6513189c8;p=git.git diff --git a/git-bisect.sh b/git-bisect.sh index 8dc77c99..d92993b9 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -1,5 +1,5 @@ #!/bin/sh -. git-sh-setup || dir "Not a git archive" +. git-sh-setup usage() { echo >&2 'usage: git bisect [start|bad|good|next|reset|visualize] @@ -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" }