@matheusbsbs / matheus-bagliano / commits / 6fecf1915c
Fork 0

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 <junkio@cox.net>

Junio C Hamano committed Apr 5, 2007 at 22:51 UTC 6fecf1915c5fd0b14e2ca2ec9e1a6b620abfb5c2
1 file changed +4 -5
git-bisect.sh
+4 -5
@@ -169,11 +169,10 @@ bisect_write_good() {
169
170 bisect_next_check() {
171 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 +
176 case "$next_ok,$1" in
177 no,) false ;;
178 no,fail)