summaryrefslogtreecommitdiff
path: root/t/t6030-bisect-run.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2007-04-05 23:27:44 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2007-04-06 17:55:57 -0700
commit0a5280a9f444c33b0e4ebf2f073df5899c112cf8 (patch)
treecd6e6a6ceda6d4019ef1a0610646e05a95b32c73 /t/t6030-bisect-run.sh
parentt6030: add a bit more tests to git-bisect (diff)
downloadtgif-0a5280a9f444c33b0e4ebf2f073df5899c112cf8.tar.xz
git-bisect: allow bisecting with only one bad commit.
This allows you to say: git bisect start git bisect bad $bad git bisect next to start bisection without knowing a good commit. This would have you try a commit that is half-way since the beginning of the history, which is rather wasteful if you already know a good commit, but if you don't (or your history is short enough that you do not care), there is no reason not to allow this. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't/t6030-bisect-run.sh')
-rwxr-xr-xt/t6030-bisect-run.sh17
1 files changed, 6 insertions, 11 deletions
diff --git a/t/t6030-bisect-run.sh b/t/t6030-bisect-run.sh
index 4910ff6841..de3123522a 100755
--- a/t/t6030-bisect-run.sh
+++ b/t/t6030-bisect-run.sh
@@ -4,6 +4,8 @@
#
test_description='Tests git-bisect functionality'
+exec </dev/null
+
. ./test-lib.sh
add_line_into_file()
@@ -37,21 +39,14 @@ test_expect_success \
HASH3=$(git rev-list HEAD | head -2 | tail -1) &&
HASH4=$(git rev-list HEAD | head -1)'
-test_expect_success 'bisect does not start with only one bad' '
+test_expect_success 'bisect starts with only one bad' '
git bisect reset &&
git bisect start &&
- git bisect bad $HASH4 || return 1
-
- if git bisect next
- then
- echo Oops, should have failed.
- false
- else
- :
- fi
+ git bisect bad $HASH4 &&
+ git bisect next
'
-test_expect_success 'bisect does not start with only one good' '
+test_expect_success 'bisect starts with only one good' '
git bisect reset &&
git bisect start &&
git bisect good $HASH1 || return 1