Git fork

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 <me@ttaylorr.com>
Acked-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Taylor Blau and committed by
Junio C Hamano
7fb12bb2 1b01b03e

+2 -7
+2 -7
t/t7704-repack-cruft.sh
··· 618 618 ) 619 619 ' 620 620 621 - write_blob () { 622 - test-tool genrandom "$@" >in && 623 - git hash-object -w -t blob in 624 - } 625 - 626 621 find_pack () { 627 622 for idx in $(ls $packdir/pack-*.idx) 628 623 do ··· 641 636 test_commit base && 642 637 643 638 # 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) && 646 641 test-tool chmtime --get -1000 \ 647 642 "$objdir/$(test_oid_to_path $foo)" >foo.mtime && 648 643 test-tool chmtime --get -2000 \