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

[PATCH] t5500: do not depend on the way an earlier pull fails

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 18, 2016, 19:31 UTC
Message-ID
<xmqqzitvpopd.fsf@gitster.mtv.corp.google.com>

Three tests before the test updated here is a test that is called 'pull in shallow repo with missing merge base' and does this:

    test_must_fail git pull --depth 4 .. A

While attempting to create a merge after fetching necessary objects, the current implementation happens to create a throw-away object to represent a conflicted merge result before failing. This object is not connected to any of the refs in the result (i.e. prunable).

The test touched by this patch counts the number of loose objects and depends on the presence of this prunable garbage. Once we improve the implementation of "merge" not to leave such a throw-away object in the object database, this will start failing.

Remove the throw-away object, if any, before counting in order to future-proof this test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t5500-fetch-pack.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index e5f83bf..f4e479a 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -279,9 +279,10 @@ test_expect_success 'clone shallow depth count' '
 test_expect_success 'clone shallow object count' '
 	(
 		cd shallow &&
+		git prune &&
 		git count-objects -v
 	) > count.shallow &&
-	grep "^count: 55" count.shallow
+	grep "^count: 54" count.shallow
 '
 
 test_expect_success 'fetch --no-shallow on full repo' '
Message 1 of 1 in “t5500: do not depend on the way an earlier pull fails”
  1. t5500: do not depend on the way an earlier pull failsJunio C Hamano, Mar 18, 2016

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.