Skip to contentSkip to conversation

p5551: fix repeated runs with update-ref --no-deref

PATCH In review Jon Simons 3 participants 3 messages Sep 26 – Sep 28

lore
Share & tools
lore

Jon Simons

author
#0 lore raw

PATCH 1/1 p5551: fix repeated runs with update-ref --no-deref

Update p5551-fetch-rescan.sh to pass --no-deref when deleting child test refs before each measured git fetch. Otherwise, for repeated runs, the second iteration will fail with:

fatal: multiple updates for 'refs/remotes/origin/master' (including one via symref 'refs/remotes/origin/HEAD') are not allowed

Starting with 3f763ddf28 (fetch: set remote/HEAD if it does not exist, 2024-11-22), git fetch instantiates the HEAD symref.

The test, introduced in 7893bf1720 (p5551: add a script to test fetch pack-dir rescans, 2017-11-20), predates that.

---
 t/perf/p5551-fetch-rescan.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/perf/p5551-fetch-rescan.sh +1 -1
index b99dc23e32..0b3ff632fc 100755
@@ -45,7 +45,7 @@ test_perf 'fetch' '
 	(
 		cd child &&
 		$MODERN_GIT for-each-ref --format="delete %(refname)" refs/remotes |
-		$MODERN_GIT update-ref --stdin &&
+		$MODERN_GIT update-ref --stdin --no-deref &&
 		rm -vf .git/objects/$(echo $obj | sed "s|^..|&/|") &&
 
 		git fetch

base-commit: 0f8e75abebff0877cae681a3d5ff31ac47f54220

Signature · 1 line
2.55.0
#1 lore raw
Quoted 4 lines · Jon Simons

Update p5551-fetch-rescan.sh to pass --no-deref when deleting child test refs before each measured git fetch. Otherwise, for repeated runs, the second iteration will fail with:

Quoted 8 lines

fatal: multiple updates for 'refs/remotes/origin/master' (including one via symref 'refs/remotes/origin/HEAD') are not allowed

Starting with 3f763ddf28 (fetch: set remote/HEAD if it does not exist, 2024-11-22), git fetch instantiates the HEAD symref.

The test, introduced in 7893bf1720 (p5551: add a script to test fetch pack-dir rescans, 2017-11-20), predates that.

Thanks, the explanation and patch both make sense.

This test could probably benefit from using --setup (which also didn't exist back when this test was written). But that's nothing new, and well outside the scope of your patch.

-Peff

#2 lore raw
Quoted 15 lines · Jeff King
Quoted 4 lines · Jon Simons

Update p5551-fetch-rescan.sh to pass --no-deref when deleting child test refs before each measured git fetch. Otherwise, for repeated runs, the second iteration will fail with:

Quoted 8 lines

fatal: multiple updates for 'refs/remotes/origin/master' (including one via symref 'refs/remotes/origin/HEAD') are not allowed

Starting with 3f763ddf28 (fetch: set remote/HEAD if it does not exist, 2024-11-22), git fetch instantiates the HEAD symref.

The test, introduced in 7893bf1720 (p5551: add a script to test fetch pack-dir rescans, 2017-11-20), predates that.

Quoted 7 lines

Thanks, the explanation and patch both make sense.

This test could probably benefit from using --setup (which also didn't exist back when this test was written). But that's nothing new, and well outside the scope of your patch.

-Peff

Thanks for writing and reviewing. Will queue and mark for 'next'.