Skip to content

Commit 6fecf19

Browse files
author
Junio C Hamano
committed
git-bisect: modernization
This slightly modernizes the bisect script to use show-ref/for-each-ref instead of looking into $GIT_DIR/refs files directly. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6fe9c57 commit 6fecf19

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

git-bisect.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,10 @@ bisect_write_good() {
169169

170170
bisect_next_check() {
171171
next_ok=no
172-
test -f "$GIT_DIR/refs/bisect/bad" &&
173-
case "$(cd "$GIT_DIR" && echo refs/bisect/good-*)" in
174-
refs/bisect/good-\*) ;;
175-
*) next_ok=yes ;;
176-
esac
172+
git show-ref -q --verify refs/bisect/bad &&
173+
test -n "$(git for-each-ref "refs/bisect/good-*")" &&
174+
next_ok=yes
175+
177176
case "$next_ok,$1" in
178177
no,) false ;;
179178
no,fail)

0 commit comments

Comments
 (0)