From 0678e01f0211f4e3310f3c01b3425da53aa63677 Mon Sep 17 00:00:00 2001 From: Aaron Plattner Date: Wed, 18 Feb 2026 10:10:19 -0800 Subject: [PATCH] t: use test_seq -f and pipes in a few more places Several tests use a pattern that writes to a temporary file like this: printf "do something with %d\n" $(test_seq ) >tmpfile && git do-something --stdin >input && git do-something --stdin | git do-something --stdin Signed-off-by: Aaron Plattner Signed-off-by: Junio C Hamano --- t/pack-refs-tests.sh | 24 ++++++++++-------------- t/t0613-reftable-write-options.sh | 16 ++++++++-------- t/t1400-update-ref.sh | 8 ++++---- t/t1460-refs-migrate.sh | 8 ++++---- t/t5004-archive-corner-cases.sh | 3 +-- t/t5401-update-hooks.sh | 4 ++-- 6 files changed, 29 insertions(+), 34 deletions(-) diff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh index 81086c3690..2fdaccb6c7 100644 --- a/t/pack-refs-tests.sh +++ b/t/pack-refs-tests.sh @@ -354,8 +354,8 @@ do # Create 14 additional references, which brings us to # 15 together with the default branch. - printf "create refs/heads/loose-%d HEAD\n" $(test_seq 14) >stdin && - git update-ref --stdin stdin && - git update-ref --stdin stdin && - git update-ref --stdin stdin && - git update-ref --stdin stdin && - git update-ref --stdin input && - git update-ref --stdin expect <<-EOF && @@ -178,8 +178,8 @@ test_expect_success 'restart interval at every single record' ' ( cd repo && test_commit initial && - test_seq -f "update refs/heads/branch-%d HEAD" 10 >input && - git update-ref --stdin expect <<-EOF && @@ -218,8 +218,8 @@ test_expect_success 'object index gets written by default with ref index' ' ( cd repo && test_commit initial && - test_seq -f "update refs/heads/branch-%d HEAD" 5 >input && - git update-ref --stdin expect <<-EOF && @@ -253,8 +253,8 @@ test_expect_success 'object index can be disabled' ' ( cd repo && test_commit initial && - test_seq -f "update refs/heads/branch-%d HEAD" 5 >input && - git update-ref --stdin expect <<-EOF && diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index db7f5444da..0f68a7dd42 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -1380,16 +1380,16 @@ test_expect_success 'fails with duplicate ref update via symref' ' test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' ' ( - test_seq -f "create refs/heads/%d HEAD" 33 >large_input && - run_with_limited_open_files git update-ref --stdin large_input && - run_with_limited_open_files git update-ref --stdin stdin && - git -C repo update-ref --stdin stdin && - git -C repo update-ref --stdin tree && - tree=$(git mktree input && - git update-ref --stdin