Skip to content

Commit 4f50671

Browse files
author
Junio C Hamano
committed
t6030: add a bit more tests to git-bisect
Verify that git-bisect does not start before getting one bad and one good commit. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6fecf19 commit 4f50671

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

t/t6030-bisect-run.sh

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Copyright (c) 2007 Christian Couder
44
#
5-
test_description='Tests git-bisect run functionality'
5+
test_description='Tests git-bisect functionality'
66

77
. ./test-lib.sh
88

@@ -37,6 +37,42 @@ test_expect_success \
3737
HASH3=$(git rev-list HEAD | head -2 | tail -1) &&
3838
HASH4=$(git rev-list HEAD | head -1)'
3939

40+
test_expect_success 'bisect does not start with only one bad' '
41+
git bisect reset &&
42+
git bisect start &&
43+
git bisect bad $HASH4 || return 1
44+
45+
if git bisect next
46+
then
47+
echo Oops, should have failed.
48+
false
49+
else
50+
:
51+
fi
52+
'
53+
54+
test_expect_success 'bisect does not start with only one good' '
55+
git bisect reset &&
56+
git bisect start &&
57+
git bisect good $HASH1 || return 1
58+
59+
if git bisect next
60+
then
61+
echo Oops, should have failed.
62+
false
63+
else
64+
:
65+
fi
66+
'
67+
68+
test_expect_success 'bisect start with one bad and good' '
69+
git bisect reset &&
70+
git bisect start &&
71+
git bisect good $HASH1 &&
72+
git bisect bad $HASH4 &&
73+
git bisect next
74+
'
75+
4076
# We want to automatically find the commit that
4177
# introduced "Another" into hello.
4278
test_expect_success \

0 commit comments

Comments
 (0)