summaryrefslogtreecommitdiff
path: root/t/t6030-bisect-porcelain.sh
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2007-11-20 06:39:53 +0100
committerJunio C Hamano <gitster@pobox.com>2007-11-20 01:01:46 -0800
commitfce0499fad13815d936c1068b7a064030f543b3d (patch)
treedd749b31846e1c17feff0f76e252de8ff2dc5de6 /t/t6030-bisect-porcelain.sh
parent6459c7c6786aa9bda0c7a095c9db66c36da0e5f0 (diff)
downloadgit-fce0499fad13815d936c1068b7a064030f543b3d.tar.gz
Bisect reset: do nothing when not bisecting.
Before this patch, using "git bisect reset" when not bisecting did a "git checkout master" for no good reason. This also happened using "git bisect replay" when not bisecting because "bisect_replay" starts by calling "bisect_reset". 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.sh27
1 files changed, 26 insertions, 1 deletions
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index f09db6244e..2ba4b00e52 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -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
'