* cc/bisect:
bisect: use a detached HEAD to bisect
bisect: trap critical errors in "bisect_start"
bisect: fix left over "BISECT_START" file when starting with junk rev
bisect: add test cases to check that "git bisect start" is atomic
# so we should find $HASH2 as the first bad commit
@ -281,25 +322,6 @@ test_expect_success 'bisect starting with a detached HEAD' '
@@ -281,25 +322,6 @@ test_expect_success 'bisect starting with a detached HEAD' '
test $HEAD = $(cat .git/BISECT_START) &&
git bisect reset &&
test $HEAD = $(git rev-parse --verify HEAD)
'
test_expect_success 'bisect refuses to start if branch bisect exists' '
git bisect reset &&
git branch bisect &&
test_must_fail git bisect start &&
git branch -d bisect &&
git checkout -b bisect &&
test_must_fail git bisect start &&
git checkout master &&
git branch -d bisect
'
test_expect_success 'bisect refuses to start if branch new-bisect exists' '
git bisect reset &&
git branch new-bisect &&
test_must_fail git bisect start &&
git branch -d new-bisect
'
test_expect_success 'bisect errors out if bad and good are mistaken' '
@ -309,6 +331,25 @@ test_expect_success 'bisect errors out if bad and good are mistaken' '
@@ -309,6 +331,25 @@ test_expect_success 'bisect errors out if bad and good are mistaken' '
git bisect reset
'
test_expect_success 'bisect does not create a "bisect" branch' '
git bisect reset &&
git bisect start $HASH7 $HASH1 &&
git branch bisect &&
rev_hash4=$(git rev-parse --verify HEAD) &&
test "$rev_hash4" = "$HASH4" &&
git branch -D bisect &&
git bisect good &&
git branch bisect &&
rev_hash6=$(git rev-parse --verify HEAD) &&
test "$rev_hash6" = "$HASH6" &&
git bisect good > my_bisect_log.txt &&
grep "$HASH7 is first bad commit" my_bisect_log.txt &&