]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/t5313-pack-bounds-checks.sh: prepare for sub-directories
authorTaylor Blau <me@ttaylorr.com>
Tue, 6 Aug 2024 15:38:04 +0000 (11:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 6 Aug 2024 19:01:39 +0000 (12:01 -0700)
Prepare for sub-directories to appear in $GIT_DIR/objects/pack by
adjusting the copy, remove, and chmod invocations to perform their
behavior recursively.

This prepares us for the new $GIT_DIR/objects/pack/multi-pack-index.d
directory which will be added in a following commit.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5313-pack-bounds-checks.sh

index ceaa6700a27230cdea34bd65aeff2db34c53ad64..86fc73f9fbac4dd5ed2b0c130daa035fa0efe4a3 100755 (executable)
@@ -7,11 +7,11 @@ TEST_PASSES_SANITIZE_LEAK=true
 
 clear_base () {
        test_when_finished 'restore_base' &&
-       rm -f $base
+       rm -r -f $base
 }
 
 restore_base () {
-       cp base-backup/* .git/objects/pack/
+       cp -r base-backup/* .git/objects/pack/
 }
 
 do_pack () {
@@ -64,9 +64,9 @@ test_expect_success 'set up base packfile and variables' '
        git commit -m base &&
        git repack -ad &&
        base=$(echo .git/objects/pack/*) &&
-       chmod +w $base &&
+       chmod -R +w $base &&
        mkdir base-backup &&
-       cp $base base-backup/ &&
+       cp -r $base base-backup/ &&
        object=$(git rev-parse HEAD:file)
 '