X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-bisect.sh;h=7a6521ec3c62b04fe6d4c3e80c418ccc02b4ec65;hb=faf8280850e9af4ef63decd8d4e65a7609544c21;hp=2b20037a11687d4d867038d5544c81d709fce8ac;hpb=e3f062bfd412adafb7ed6a8f24a3ec89d39211fc;p=git.git diff --git a/git-bisect.sh b/git-bisect.sh index 2b20037a1..7a6521ec3 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -22,6 +22,7 @@ git bisect log git bisect run ... use ... to automatically bisect.' +OPTIONS_SPEC= . git-sh-setup require_work_tree @@ -36,7 +37,7 @@ sq() { } bisect_autostart() { - test -d "$GIT_DIR/refs/bisect" || { + test -f "$GIT_DIR/BISECT_NAMES" || { echo >&2 'You need to start by "git bisect start"' if test -t 0 then @@ -82,7 +83,6 @@ bisect_start() { # Get rid of any old bisect state # bisect_clean_state - mkdir "$GIT_DIR/refs/bisect" # # Check for one bad and then some good revisions. @@ -191,7 +191,7 @@ bisect_next_check() { ;; *) THEN='' - test -d "$GIT_DIR/refs/bisect" || { + test -f "$GIT_DIR/BISECT_NAMES" || { echo >&2 'You need to start by "git bisect start".' THEN='then ' } @@ -329,6 +329,10 @@ bisect_visualize() { } bisect_reset() { + test -f "$GIT_DIR/BISECT_NAMES" || { + echo "We are not bisecting." + return + } case "$#" in 0) if [ -s "$GIT_DIR/head-name" ]; then branch=`cat "$GIT_DIR/head-name"` @@ -348,8 +352,6 @@ bisect_reset() { } bisect_clean_state() { - rm -fr "$GIT_DIR/refs/bisect" - # There may be some refs packed during bisection. git for-each-ref --format='%(refname) %(objectname)' refs/bisect/\* refs/heads/bisect | while read ref hash