threads / patch / 41740

patcht5500: do not depend on the way an earlier pull fails

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

## tl;dr

One message between Mar 18, 2016 and Mar 18, 2016. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Junio C Hamano· Mar 18, 2016, 19:31 UTC · lore

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(-)
Show changes to t/t5500-fetch-pack.sh +2 −1
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' '

← back to recent threads