{"thread":{"id":"13623","subject":"[PATCH 1/3] bisect: add test cases to check that \"git bisect start\" is atomic","startedAt":"2008-05-22T22:38:46Z","lastAt":"2008-05-22T22:38:46Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"77505","messageId":"20080523003846.0cd787b1.chriscool@tuxfamily.org","threadId":"13623","inReplyTo":null,"subject":"[PATCH 1/3] bisect: add test cases to check that \"git bisect start\" is atomic","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-05-22T22:38:46Z","receivedAt":"2008-05-22T22:38:46Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"This patch add some test cases to check that \"git bisect start\"\ndoesn't leave us in a bad state, especially when it fails.\n\nThese test cases show that \"git bisect start\" is not atomic when it\nfails and leave some files like \".git/BISECT_START, and in some\ncases some refs, over.\n\nThe test failures should be fixed in latter commits.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n t/t6030-bisect-porcelain.sh |   43 +++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 43 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh\nindex 933f567..7557fa1 100755\n--- a/t/t6030-bisect-porcelain.sh\n+++ b/t/t6030-bisect-porcelain.sh\n@@ -126,6 +126,49 @@ test_expect_success 'bisect reset removes packed refs' '\n \ttest -z \"$(git for-each-ref \"refs/heads/bisect\")\"\n '\n \n+test_expect_success 'bisect start: back in good branch' '\n+\tgit branch > branch.output &&\n+\tgrep \"* other\" branch.output > /dev/null &&\n+\tgit bisect start $HASH4 $HASH1 -- &&\n+\tgit bisect good &&\n+\tgit bisect start $HASH4 $HASH1 -- &&\n+\tgit bisect bad &&\n+\tgit bisect reset &&\n+\tgit branch > branch.output &&\n+\tgrep \"* other\" branch.output > /dev/null\n+'\n+\n+test_expect_failure 'bisect start: no \".git/BISECT_START\" if junk rev' '\n+\tgit bisect start $HASH4 $HASH1 -- &&\n+\tgit bisect good &&\n+\ttest_must_fail git bisect start $HASH4 foo -- &&\n+\tgit branch > branch.output &&\n+\tgrep \"* other\" branch.output > /dev/null &&\n+\ttest_must_fail test -e .git/BISECT_START\n+'\n+\n+test_expect_failure 'bisect start: no \".git/BISECT_START\" if mistaken rev' '\n+\tgit bisect start $HASH4 $HASH1 -- &&\n+\tgit bisect good &&\n+\ttest_must_fail git bisect start $HASH1 $HASH4 -- &&\n+\tgit branch > branch.output &&\n+\tgrep \"* other\" branch.output > /dev/null &&\n+\ttest_must_fail test -e .git/BISECT_START\n+'\n+\n+test_expect_failure 'bisect start: no \".git/BISECT_START\" if checkout error' '\n+\techo \"temp stuff\" > hello &&\n+\ttest_must_fail git bisect start $HASH4 $HASH1 -- &&\n+\tgit branch &&\n+\tgit branch > branch.output &&\n+\tgrep \"* other\" branch.output > /dev/null &&\n+\ttest_must_fail test -e .git/BISECT_START &&\n+\ttest -z \"$(git for-each-ref \"refs/bisect/*\")\"\n+'\n+\n+# This cleanup is needed whatever the result of the above test.\n+git checkout HEAD hello\n+\n # $HASH1 is good, $HASH4 is bad, we skip $HASH3\n # but $HASH2 is bad,\n # so we should find $HASH2 as the first bad commit\n-- \n1.5.5.1.501.g204d8.dirty\n"}]}