Bisect run: "skip" current commit if script exit code is 125.
[gitweb.git] / git-bisect.sh
index f8d0099059b2f9bdb27e2bad4f742752ee18c502..180c6c280c8dd2e9622dff26399a6b91540d54fd 100755 (executable)
@@ -392,7 +392,10 @@ bisect_run () {
       fi
 
       # Find current state depending on run success or failure.
-      if [ $res -gt 0 ]; then
+      # A special exit code of 125 means cannot test.
+      if [ $res -eq 125 ]; then
+         state='skip'
+      elif [ $res -gt 0 ]; then
          state='bad'
       else
          state='good'
@@ -404,6 +407,12 @@ bisect_run () {
 
       cat "$GIT_DIR/BISECT_RUN"
 
+      if grep "first bad commit could be any of" "$GIT_DIR/BISECT_RUN" \
+               > /dev/null; then
+         echo >&2 "bisect run cannot continue any more"
+         exit $res
+      fi
+
       if [ $res -ne 0 ]; then
          echo >&2 "bisect run failed:"
          echo >&2 "'bisect_state $state' exited with error code $res"