Skip to content

Commit 7fb12bb

Browse files
ttaylorrgitster
authored andcommitted
t/t7704-repack-cruft.sh: consolidate write_blob()
A previous commit moved a handful of tests from a different script into t7704, including one that relies on generating random blobs. Incidentally, the original home of this test defined its own helper "write_blob" for doing so, which is identical in function to our "generate_random_blob" (and is slightly inferior to the latter, which cleans up after itself). Rewrite the test that uses "write_blob" to no longer do so and then remove the function. Signed-off-by: Taylor Blau <[email protected]> Acked-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1b01b03 commit 7fb12bb

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

t/t7704-repack-cruft.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,6 @@ test_expect_success 'cruft repack with no reachable objects' '
618618
)
619619
'
620620

621-
write_blob () {
622-
test-tool genrandom "$@" >in &&
623-
git hash-object -w -t blob in
624-
}
625-
626621
find_pack () {
627622
for idx in $(ls $packdir/pack-*.idx)
628623
do
@@ -641,8 +636,8 @@ test_expect_success 'cruft repack with --max-pack-size' '
641636
test_commit base &&
642637
643638
# two cruft objects which exceed the maximum pack size
644-
foo=$(write_blob foo 1048576) &&
645-
bar=$(write_blob bar 1048576) &&
639+
foo=$(generate_random_blob foo 1048576) &&
640+
bar=$(generate_random_blob bar 1048576) &&
646641
test-tool chmtime --get -1000 \
647642
"$objdir/$(test_oid_to_path $foo)" >foo.mtime &&
648643
test-tool chmtime --get -2000 \

0 commit comments

Comments
 (0)