Skip to content

Commit 1aaed69

Browse files
rscharfegitster
authored andcommitted
t5000: use check_mtime()
fd2da4b (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fd2da4b commit 1aaed69

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

t/t5000-tar-tree.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ test_expect_success 'git archive' '
185185
'
186186

187187
check_tar b
188+
check_mtime b a/a 1117231200
188189

189190
test_expect_success 'git archive --mtime' '
190191
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' '
257258
test_cmp_bin b.tar b5-nick.tar
258259
'
259260

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-
268261
test_expect_success 'git get-tar-commit-id' '
269262
git get-tar-commit-id <b.tar >actual &&
270263
git rev-parse HEAD >expect &&

0 commit comments

Comments
 (0)