]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5319: replace 'touch -m' with 'test-tool chmtime'
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 1 Apr 2020 21:00:43 +0000 (21:00 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Apr 2020 21:37:50 +0000 (14:37 -0700)
The use of 'touch -m' to modify a file's mtime is slightly less
portable than using our own 'test-tool chmtime'. The important
thing is that these pack-files are ordered in a special way to
ensure the multi-pack-index selects some as the "newer" pack-files
when resolving duplicate objects.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5319-multi-pack-index.sh

index c72ca0439993bb25b3d0e25fa2ce5d399b49a2b7..37237f024c007b72ce1180808c1c9a9065f13b23 100755 (executable)
@@ -438,10 +438,10 @@ test_expect_success 'repack with minimum size does not alter existing packs' '
                cd dup &&
                rm -rf .git/objects/pack &&
                mv .git/objects/pack-backup .git/objects/pack &&
-               touch -m -t 201901010000 .git/objects/pack/pack-D* &&
-               touch -m -t 201901010001 .git/objects/pack/pack-C* &&
-               touch -m -t 201901010002 .git/objects/pack/pack-B* &&
-               touch -m -t 201901010003 .git/objects/pack/pack-A* &&
+               test-tool chmtime =-5 .git/objects/pack/pack-D* &&
+               test-tool chmtime =-4 .git/objects/pack/pack-C* &&
+               test-tool chmtime =-3 .git/objects/pack/pack-B* &&
+               test-tool chmtime =-2 .git/objects/pack/pack-A* &&
                ls .git/objects/pack >expect &&
                MINSIZE=$(test-tool path-utils file-size .git/objects/pack/*pack | sort -n | head -n 1) &&
                git multi-pack-index repack --batch-size=$MINSIZE &&