]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-bisect.sh
t4135-*.sh: Skip the "backslash" tests on cygwin
[thirdparty/git.git] / git-bisect.sh
index 6e2acb8ef29e5003945bed17014a68b141ada454..c21e33c8d133af0e9e0ae3edaffd0a5593ff4ac3 100755 (executable)
@@ -316,7 +316,12 @@ bisect_reset() {
        *)
            usage ;;
        esac
-       git checkout "$branch" -- && bisect_clean_state
+       if git checkout "$branch" -- ; then
+               bisect_clean_state
+       else
+               die "Could not check out original HEAD '$branch'." \
+                               "Try 'git bisect reset <commit>'."
+       fi
 }
 
 bisect_clean_state() {
@@ -338,6 +343,7 @@ bisect_clean_state() {
 }
 
 bisect_replay () {
+       test "$#" -eq 1 || die "No logfile given"
        test -r "$1" || die "cannot read $1 for replaying"
        bisect_reset
        while read git bisect command rev
@@ -412,6 +418,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 +448,7 @@ case "$#" in
     replay)
        bisect_replay "$@" ;;
     log)
-       cat "$GIT_DIR/BISECT_LOG" ;;
+       bisect_log ;;
     run)
         bisect_run "$@" ;;
     *)