]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5000: use check_mtime()
authorRené Scharfe <l.s.r@web.de>
Sat, 25 Mar 2023 12:16:32 +0000 (13:16 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Mar 2023 16:13:30 +0000 (09:13 -0700)
fd2da4b1ea (archive: add --mtime, 2023-02-18) added a helper function
for checking the file modification time of an extracted entry.  Use it
for the older mtime test as well to shorten the code and piggyback on
the archive extraction done to validate file contents.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5000-tar-tree.sh

index 918a2fc7c69432c26e3135460d62f9b27f0e3dbd..f0bd70dbd6aa7468c7812f36d3af755b91ccb3fb 100755 (executable)
@@ -185,6 +185,7 @@ test_expect_success 'git archive' '
 '
 
 check_tar b
+check_mtime b a/a 1117231200
 
 test_expect_success 'git archive --mtime' '
        git archive --mtime=2002-02-02T02:02:02-0200 HEAD >with_mtime.tar
@@ -257,14 +258,6 @@ test_expect_success 'git archive --remote with configured remote' '
        test_cmp_bin b.tar b5-nick.tar
 '
 
-test_expect_success 'validate file modification time' '
-       mkdir extract &&
-       "$TAR" xf b.tar -C extract a/a &&
-       test-tool chmtime --get extract/a/a >b.mtime &&
-       echo "1117231200" >expected.mtime &&
-       test_cmp expected.mtime b.mtime
-'
-
 test_expect_success 'git get-tar-commit-id' '
        git get-tar-commit-id <b.tar >actual &&
        git rev-parse HEAD >expect &&