bisect: improve error message of 'bisect log' while not bisecting
[gitweb.git] / git-bisect.sh
index 6e2acb8ef29e5003945bed17014a68b141ada454..3a4bf8150d1e568711cf77a9caa96e2877eb74ea 100755 (executable)
@@ -412,6 +412,10 @@ bisect_run () {
     done
 }
 
+bisect_log () {
+       test -s "$GIT_DIR/BISECT_LOG" || die "We are not bisecting."
+       cat "$GIT_DIR/BISECT_LOG"
+}
 
 case "$#" in
 0)
@@ -438,7 +442,7 @@ case "$#" in
     replay)
        bisect_replay "$@" ;;
     log)
-       cat "$GIT_DIR/BISECT_LOG" ;;
+       bisect_log ;;
     run)
         bisect_run "$@" ;;
     *)