DORMANTno replies

[PATCH] t6030: add test for git bisect skip started with --term* arguments

From: Bagas Sanjaya <hidden>
Date: 2021-04-23 07:07:43
Subsystem: the rest · Maintainer: Linus Torvalds

Trygve Aaberge reported [1] git bisect breakage when the bisection
is started with --term* arguments (--term-new and --term-old). In that
case, skipping with `git bisect skip` should cause HEAD to be changed,
but actually the HEAD stayed same after skipping.

Let's add the test to catch the breakage. Because there isn't any fixes
yet, mark the test as test_expect_failure.

[1]: https://lore.kernel.org/git/20210418151459.GC10839@aaberge.net/ (local)

Signed-off-by: Bagas Sanjaya <redacted>
---

Junio suggested that I should had written this test in t6030, not in
separate script as per [2], so that I could reuse the history from
existing tests.

[2]: https://lore.kernel.org/git/xmqqa6przh08.fsf@gitster.g/ (local)

 t/t6030-bisect-porcelain.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 32bb66e1ed..c500fa893d 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -299,6 +299,18 @@ test_expect_success 'bisect skip and bisect replay' '
 	git bisect reset
 '
 
+# Bisect is started with --term-new and --term-old arguments,
+# then skip. The HEAD should be changed.
+# FIXME: Mark this test as test_expect_failure. Remove the FIXME and
+# mark as test_expect_success when this test successes (fixed bug).
+test_expect_failure '"bisect skip: bisection is started with --term*"' '
+	git bisect start --term-new=fixed --term-old=unfixed $HASH5 $HASH1 &&
+	HASH_SKIPPED_FROM=$(git rev-parse --verify HEAD) &&
+	git bisect skip &&
+	HASH_SKIPPED_TO=$(git rev-parse --verify HEAD) &&
+	test $HASH_SKIPPED_FROM != $HASH_SKIPPED_TO
+'
+
 HASH6=
 test_expect_success 'bisect run & skip: cannot tell between 2' '
 	add_line_into_file "6: Yet a line." hello &&
base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help