git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] t6030: add a bit more tests to git-bisect

From
Junio C Hamano <junkio@cox.net>
Date
Apr 6, 2007, 06:30 UTC
Message-ID
<7v648ako9x.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<20070404071202.483030b8.chriscool@tuxfamily.org>

Verify that git-bisect does not start before getting one bad and one good commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 t/t6030-bisect-run.sh |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/t/t6030-bisect-run.sh b/t/t6030-bisect-run.sh
index 455dc60..1c38f08 100755
--- a/t/t6030-bisect-run.sh
+++ b/t/t6030-bisect-run.sh
@@ -37,6 +37,42 @@ 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' '
+	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
+'
+
+test_expect_success 'bisect does not start with only one good' '
+	git bisect reset &&
+	git bisect start &&
+	git bisect good $HASH1 || return 1
+
+	if git bisect next
+	then
+		echo Oops, should have failed.
+		false
+	else
+		:
+	fi
+'
+
+test_expect_success 'bisect start with one bad and good' '
+	git bisect reset &&
+	git bisect start &&
+	git bisect good $HASH1 &&
+	git bisect bad $HASH4 &&
+	git bisect next
+'
+
 # We want to automatically find the commit that
 # introduced "Another" into hello.
 test_expect_success \
-- 
1.5.1.53.g77e6f
Previous: Junio C Hamano
Message 9 of 9 in “Bisect: teach "bisect start" to optionally use one bad and many good revs.”
  1. Bisect: teach "bisect start" to optionally use one bad and many good revs.Christian Couder, Apr 1, 2007
  2. Junio C HamanoApr 3, 2007
  3. Bisect: teach "bisect start" to optionally use one bad and many good revs.Christian Couder, Apr 4, 2007
  4. Documentation: bisect: "start" accepts one bad and many good commitsChristian Couder, Apr 5, 2007
  5. Junio C HamanoApr 5, 2007
  6. 2/2 git-bisect: allow bisecting with only one bad commit.Junio C Hamano, Apr 6, 2007
  7. Christian CouderApr 17, 2007
  8. Junio C HamanoApr 17, 2007
  9. 1/2 t6030: add a bit more tests to git-bisectJunio C Hamano, Apr 6, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.