t5000: use check_mtime()

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>

René Scharfe committed Mar 25, 2023 at 13:16 UTC 1aaed69d11f216a96004518cbea3fadd28fbf530
1 file changed +1 -8
t/t5000-tar-tree.sh
+1 -8
@@ -185,6 +185,7 @@ test_expect_success 'git archive' '
185 '
186
187 check_tar b
188 +check_mtime b a/a 1117231200
189
190 test_expect_success 'git archive --mtime' '
191 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' '
258 test_cmp_bin b.tar b5-nick.tar
259 '
260
260 -test_expect_success 'validate file modification time' '
261 - mkdir extract &&
262 - "$TAR" xf b.tar -C extract a/a &&
263 - test-tool chmtime --get extract/a/a >b.mtime &&
264 - echo "1117231200" >expected.mtime &&
265 - test_cmp expected.mtime b.mtime
266 -'
267 -
261 test_expect_success 'git get-tar-commit-id' '
262 git get-tar-commit-id <b.tar >actual &&
263 git rev-parse HEAD >expect &&