Skip to content

Commit 2e4afda

Browse files
pks-tgitster
authored andcommitted
t5551: stop writing packed-refs directly
We have multiple tests in t5551 that write thousands of tags. To do so efficiently we generate the tags by writing the `packed-refs` file directly, which of course assumes that the reference database is backed by the files backend. Refactor the code to instead use a single `git update-ref --stdin` command to write the tags. While the on-disk end result is not the same as we now have a bunch of loose refs instead of a single packed-refs file, the distinction shouldn't really matter for any of the tests that use this helper. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 853bd0d commit 2e4afda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

t/t5551-http-fetch-smart.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@ create_tags () {
359359

360360
# now assign tags to all the dangling commits we created above
361361
tag=$(perl -e "print \"bla\" x 30") &&
362-
sed -e "s|^:\([^ ]*\) \(.*\)$|\2 refs/tags/$tag-\1|" <marks >>packed-refs
362+
sed -e "s|^:\([^ ]*\) \(.*\)$|create refs/tags/$tag-\1 \2|" <marks >input &&
363+
git update-ref --stdin <input &&
364+
rm input
363365
}
364366

365367
test_expect_success 'create 2,000 tags in the repo' '

0 commit comments

Comments
 (0)