···317 bad_commit=$(git show-branch $bad_rev)
318 echo "# first bad commit: $bad_commit" >>"$GIT_DIR/BISECT_LOG"
319 exit 0
0000000000320 fi
321322 # Check for an error in the bisection process
···317 bad_commit=$(git show-branch $bad_rev)
318 echo "# first bad commit: $bad_commit" >>"$GIT_DIR/BISECT_LOG"
319 exit 0
320+ elif test $res -eq 2
321+ then
322+ echo "# only skipped commits left to test" >>"$GIT_DIR/BISECT_LOG"
323+ good_revs=$(git for-each-ref --format="--not %(objectname)" "refs/bisect/good-*")
324+ for skipped in $(git rev-list refs/bisect/bad $good_revs)
325+ do
326+ skipped_commit=$(git show-branch $skipped)
327+ echo "# possible first bad commit: $skipped_commit" >>"$GIT_DIR/BISECT_LOG"
328+ done
329+ exit $res
330 fi
331332 # Check for an error in the bisection process
···759 git bisect reset
760'
761762+cat > expected.bisect-skip-log <<EOF
763+# bad: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
764+# good: [7b7f204a749c3125d5224ed61ea2ae1187ad046f] Add <2: A new day for git> into <hello>.
765+git bisect start '32a594a3fdac2d57cf6d02987e30eec68511498c' '7b7f204a749c3125d5224ed61ea2ae1187ad046f'
766+# skip: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
767+git bisect skip 3de952f2416b6084f557ec417709eac740c6818c
768+# only skipped commits left to test
769+# possible first bad commit: [32a594a3fdac2d57cf6d02987e30eec68511498c] Add <4: Ciao for now> into <hello>.
770+# possible first bad commit: [3de952f2416b6084f557ec417709eac740c6818c] Add <3: Another new day for git> into <hello>.
771+EOF
772+773+test_expect_success 'bisect log: only skip commits left' '
774+ git bisect reset &&
775+ git bisect start $HASH4 $HASH2 &&
776+ test_must_fail git bisect skip &&
777+ git bisect log >bisect-skip-log.txt &&
778+ test_cmp expected.bisect-skip-log bisect-skip-log.txt &&
779+ git bisect reset
780+'
781+782test_done