# 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 &&
+ test_seq -f "create refs/heads/loose-%d HEAD" 14 |
+ git update-ref --stdin &&
test_path_is_missing .git/packed-refs &&
git ${pack_refs} --auto --all &&
test_path_is_missing .git/packed-refs &&
test_line_count = 2 .git/packed-refs &&
# Create 15 loose references.
- printf "create refs/heads/loose-%d HEAD\n" $(test_seq 15) >stdin &&
- git update-ref --stdin <stdin &&
+ test_seq -f "create refs/heads/loose-%d HEAD" 15 |
+ git update-ref --stdin &&
git ${pack_refs} --auto --all &&
test_line_count = 2 .git/packed-refs &&
# Create 99 packed refs. This should cause the heuristic
# to require more than the minimum amount of loose refs.
- test_seq 99 |
- while read i
- do
- printf "create refs/heads/packed-%d HEAD\n" $i || return 1
- done >stdin &&
- git update-ref --stdin <stdin &&
+ test_seq -f "create refs/heads/packed-%d HEAD" 99 |
+ git update-ref --stdin &&
git ${pack_refs} --all &&
test_line_count = 101 .git/packed-refs &&
# Create 24 loose refs, which should not yet cause us to repack.
- printf "create refs/heads/loose-%d HEAD\n" $(test_seq 24) >stdin &&
- git update-ref --stdin <stdin &&
+ test_seq -f "create refs/heads/loose-%d HEAD" 24 |
+ git update-ref --stdin &&
git ${pack_refs} --auto --all &&
test_line_count = 101 .git/packed-refs &&
# Note that we explicitly do not check for strict
# boundaries here, as this also depends on the size of
# the object hash.
- printf "create refs/heads/addn-%d HEAD\n" $(test_seq 10) >stdin &&
- git update-ref --stdin <stdin &&
+ test_seq -f "create refs/heads/addn-%d HEAD" 10 |
+ git update-ref --stdin &&
git ${pack_refs} --auto --all &&
test_line_count = 135 .git/packed-refs
)
(
cd repo &&
test_commit initial &&
- test_seq -f "update refs/heads/branch-%d HEAD" 200 >input &&
- git update-ref --stdin <input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 200 |
+ git update-ref --stdin &&
git pack-refs &&
cat >expect <<-EOF &&
(
cd repo &&
test_commit initial &&
- test_seq -f "update refs/heads/branch-%d HEAD" 10 >input &&
- git update-ref --stdin <input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 10 |
+ git update-ref --stdin &&
git -c reftable.restartInterval=1 pack-refs &&
cat >expect <<-EOF &&
(
cd repo &&
test_commit initial &&
- test_seq -f "update refs/heads/branch-%d HEAD" 5 >input &&
- git update-ref --stdin <input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 5 |
+ git update-ref --stdin &&
git -c reftable.blockSize=100 pack-refs &&
cat >expect <<-EOF &&
(
cd repo &&
test_commit initial &&
- test_seq -f "update refs/heads/branch-%d HEAD" 5 >input &&
- git update-ref --stdin <input &&
+ test_seq -f "update refs/heads/branch-%d HEAD" 5 |
+ git update-ref --stdin &&
git -c reftable.blockSize=100 -c reftable.indexObjects=false pack-refs &&
cat >expect <<-EOF &&
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 &&
+ test_seq -f "create refs/heads/%d HEAD" 33 |
+ run_with_limited_open_files git update-ref --stdin &&
git rev-parse --verify -q refs/heads/33
)
'
test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction deleting branches does not burst open file limit' '
(
- test_seq -f "delete refs/heads/%d HEAD" 33 >large_input &&
- run_with_limited_open_files git update-ref --stdin <large_input &&
+ test_seq -f "delete refs/heads/%d HEAD" 33 |
+ run_with_limited_open_files git update-ref --stdin &&
test_must_fail git rev-parse --verify -q refs/heads/33
)
'
test_when_finished "rm -rf repo" &&
git init --ref-format=files repo &&
test_commit -C repo first &&
- printf "create refs/heads/ref-%d HEAD\n" $(test_seq 5000) >stdin &&
- git -C repo update-ref --stdin <stdin &&
+ test_seq -f "create refs/heads/ref-%d HEAD" 5000 |
+ git -C repo update-ref --stdin &&
test_commit -C repo second &&
- printf "update refs/heads/ref-%d HEAD\n" $(test_seq 3000) >stdin &&
- git -C repo update-ref --stdin <stdin &&
+ test_seq -f "update refs/heads/ref-%d HEAD" 3000 |
+ git -C repo update-ref --stdin &&
test_migration repo reftable true
'
blob=$(echo $s | git hash-object -w --stdin) &&
# create tree containing 65500 entries of that blob
- test_seq -f "100644 blob $blob\t%d" 1 65500 >tree &&
- tree=$(git mktree <tree) &&
+ tree=$(test_seq -f "100644 blob $blob\t%d" 1 65500 | git mktree) &&
# zip it, creating an archive a bit bigger than 4GB
git archive -0 -o many-big.zip $tree &&
EOF
rm -f victim.git/hooks/update victim.git/hooks/post-update &&
- printf "create refs/heads/branch_%d main\n" $(test_seq 100 999) >input &&
- git update-ref --stdin <input &&
+ test_seq -f "create refs/heads/branch_%d main" 100 999 |
+ git update-ref --stdin &&
git push ./victim.git "+refs/heads/*:refs/heads/*"
'