unpack-objects: fix --strict handling
[gitweb.git] / t / t6030-bisect-porcelain.sh
index f09db6244e2696c0d7083df71a1797a4dc221901..4908e878fee48069fbdc339f17ad6e865111ae00 100755 (executable)
@@ -71,6 +71,31 @@ test_expect_success 'bisect start with one bad and good' '
        git bisect next
 '
 
+test_expect_success 'bisect reset: back in the master branch' '
+       git bisect reset &&
+       echo "* master" > branch.expect &&
+       git branch > branch.output &&
+       cmp branch.expect branch.output
+'
+
+test_expect_success 'bisect reset: back in another branch' '
+       git checkout -b other &&
+       git bisect start &&
+       git bisect good $HASH1 &&
+       git bisect bad $HASH3 &&
+       git bisect reset &&
+       echo "  master" > branch.expect &&
+       echo "* other" >> branch.expect &&
+       git branch > branch.output &&
+       cmp branch.expect branch.output
+'
+
+test_expect_success 'bisect reset when not bisecting' '
+       git bisect reset &&
+       git branch > branch.output &&
+       cmp branch.expect branch.output
+'
+
 test_expect_success 'bisect reset removes packed refs' '
        git bisect reset &&
        git bisect start &&
@@ -179,7 +204,7 @@ test_expect_success 'bisect skip: add line and then a new test' '
        git bisect skip &&
        git bisect good > my_bisect_log.txt &&
        grep "$HASH5 is first bad commit" my_bisect_log.txt &&
-       git bisect log > log_to_replay.txt
+       git bisect log > log_to_replay.txt &&
        git bisect reset
 '
 
@@ -229,6 +254,18 @@ test_expect_success 'bisect run & skip: find first bad' '
        grep "$HASH6 is first bad commit" my_bisect_log.txt
 '
 
+test_expect_success 'bisect starting with a detached HEAD' '
+
+       git bisect reset &&
+       git checkout master^ &&
+       HEAD=$(git rev-parse --verify HEAD) &&
+       git bisect start &&
+       test $HEAD = $(cat .git/BISECT_START) &&
+       git bisect reset &&
+       test $HEAD = $(git rev-parse --verify HEAD)
+
+'
+
 #
 #
 test_done