summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6459c7c)
raw | patch | inline | side by side (parent: 6459c7c)
author | Christian Couder <chriscool@tuxfamily.org> | |
Tue, 20 Nov 2007 05:39:53 +0000 (06:39 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 20 Nov 2007 09:01:46 +0000 (01:01 -0800) |
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>
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>
git-bisect.sh | patch | blob | history | |
t/t6030-bisect-porcelain.sh | patch | blob | history |
diff --git a/git-bisect.sh b/git-bisect.sh
index 414f813be72003c81cbe53eddaa8ab7dc6c2de64..6f20a297a5f8812935e79723a52b95306bc22306 100755 (executable)
--- a/git-bisect.sh
+++ b/git-bisect.sh
}
bisect_reset() {
+ test -f "$GIT_DIR/BISECT_NAMES" || {
+ echo "We are not bisecting."
+ return
+ }
case "$#" in
0) if [ -s "$GIT_DIR/head-name" ]; then
branch=`cat "$GIT_DIR/head-name"`
index f09db6244e2696c0d7083df71a1797a4dc221901..2ba4b00e526eb00c5d236777f896772c6cad538b 100755 (executable)
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 &&
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
'