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

[PATCH v2 2/2] bisect: add tests for bisection on bare repositories

From
Jon Seymour <jon.seymour@gmail.com>
Date
Aug 9, 2011, 01:21 UTC
Message-ID
<1312852900-29457-3-git-send-email-jon.seymour@gmail.com>
In-Reply-To
<1312852900-29457-1-git-send-email-jon.seymour@gmail.com>

We add a test to check that bisection works on bare repositories both when --no-checkout is specified explicitly and when it is defaulted.

Improved-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
 t/t6030-bisect-porcelain.sh |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 4fb7d11..62125ec 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -592,6 +592,37 @@ test_expect_success 'erroring out when using bad path parameters' '
 	grep "bad path parameters" error.txt
 '
 
+test_expect_success 'test bisection on bare repo - --no-checkout specified' '
+	git clone --bare . bare.nocheckout &&
+	(
+		cd bare.nocheckout &&
+		git bisect start --no-checkout &&
+		git bisect good $HASH1 &&
+		git bisect bad $HASH4 &&
+		git bisect run eval \
+			"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+			>../nocheckout.log &&
+		git bisect reset
+	) &&
+	grep "$HASH3 is the first bad commit" nocheckout.log
+'
+
+
+test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
+	git clone --bare . bare.defaulted &&
+	(
+		cd bare.defaulted &&
+		git bisect start &&
+		git bisect good $HASH1 &&
+		git bisect bad $HASH4 &&
+		git bisect run eval \
+			"test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+			>../defaulted.log &&
+		git bisect reset
+	) &&
+	grep "$HASH3 is the first bad commit" defaulted.log
+'
+
 #
 # This creates a broken branch which cannot be checked out because
 # the tree created has been deleted.
-- 
1.7.6.522.g810f.dirty
Previous: Jon SeymourNext: Jonathan Nieder
Message 3 of 4 in “bisect: add support for bisecting bare repositories”
  1. 0/2 bisect: add support for bisecting bare repositoriesJon Seymour, Aug 9, 2011
  2. 1/2 bisect: relax requirement for a working tree.Jon Seymour, Aug 9, 2011
  3. 2/2 bisect: add tests for bisection on bare repositoriesJon Seymour, Aug 9, 2011
  4. Jonathan NiederAug 9, 2011

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.