Bisect: use "$GIT_DIR/BISECT_NAMES" to check if we are bisecting.
Previously we tested if the "$GIT_DIR/refs/bisect" directory existed, to check if we were bisecting. Now with packed refs, it is simpler to check if the file "$GIT_DIR/BISECT_NAMES" exists, as it is already created when starting bisection and removed when reseting bisection. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Nov 18, 2007 at 16:34 UTC
6459c7c6786aa9bda0c7a095c9db66c36da0e5f0
1 file changed
+2
-5
git-bisect.sh
+2
-5
@@ -36,7 +36,7 @@ sq() {
36
}
37
38
bisect_autostart() {
39
- test -d "$GIT_DIR/refs/bisect" || {
39
+ test -f "$GIT_DIR/BISECT_NAMES" || {
40
echo >&2 'You need to start by "git bisect start"'
41
if test -t 0
42
then
@@ -82,7 +82,6 @@ bisect_start() {
82
# Get rid of any old bisect state
83
#
84
bisect_clean_state
85
- mkdir "$GIT_DIR/refs/bisect"
85
86
#
87
# Check for one bad and then some good revisions.
@@ -191,7 +190,7 @@ bisect_next_check() {
190
;;
191
*)
192
THEN=''
194
- test -d "$GIT_DIR/refs/bisect" || {
193
+ test -f "$GIT_DIR/BISECT_NAMES" || {
194
echo >&2 'You need to start by "git bisect start".'
195
THEN='then '
196
}
@@ -348,8 +347,6 @@ bisect_reset() {
347
}
348
349
bisect_clean_state() {
351
- rm -fr "$GIT_DIR/refs/bisect"
352
-
350
# There may be some refs packed during bisection.
351
git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* refs/heads/bisect |
352
while read ref hash