summaryrefslogtreecommitdiff
path: root/t/t6030-bisect-porcelain.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2008-05-22 23:28:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-23 05:45:03 (GMT)
commit634f246444e6a1675e351f31362e6a375dc44f70 (patch)
tree92602cb65cc9113cbf7f23b00c1b7c7038ffabc5 /t/t6030-bisect-porcelain.sh
parentba963de859e76a63d447345eeb3e134116d02433 (diff)
downloadgit-634f246444e6a1675e351f31362e6a375dc44f70.zip
git-634f246444e6a1675e351f31362e6a375dc44f70.tar.gz
git-634f246444e6a1675e351f31362e6a375dc44f70.tar.bz2
bisect: use a detached HEAD to bisect
When "git bisect" was first written, it was not possible to checkout a detached HEAD. The detached feature appeared latter. That's why before this patch the "git bisect" process used a "bisect" branch to checkout new revisions to be tested (and also a "new-bisect" one to check if the checkouts could work). This patch makes "git bisect" checkout revisions to be tested on a detached HEAD. This simplifies the code a bit. The tests to check that "git bisect" does not start if a "bisect" or a "new-bisect" branch exists are removed as they are not relevant any more. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6030-bisect-porcelain.sh')
-rwxr-xr-xt/t6030-bisect-porcelain.sh38
1 files changed, 19 insertions, 19 deletions
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index c4f074d..0626544 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -322,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' '
@@ -350,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 &&
+ git bisect reset &&
+ rev_hash6=$(git rev-parse --verify bisect) &&
+ test "$rev_hash6" = "$HASH6" &&
+ git branch -D bisect
+'
+
#
#
test_done