summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbf0812)
raw | patch | inline | side by side (parent: bbf0812)
author | Jeff King <peff@peff.net> | |
Tue, 13 May 2008 08:45:32 +0000 (04:45 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 14 May 2008 04:45:28 +0000 (21:45 -0700) |
The output of 'tar tv' varies from system to system. In
particular, the t5000 was expecting to parse the date from
something like:
-rw-rw-r-- root/root 0 2008-05-13 04:27 file
but FreeBSD's tar produces this:
-rw-rw-r-- 0 root root 0 May 13 04:27 file
Instead of relying on tar's output, let's just extract the
file using tar and stat the result using perl.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
particular, the t5000 was expecting to parse the date from
something like:
-rw-rw-r-- root/root 0 2008-05-13 04:27 file
but FreeBSD's tar produces this:
-rw-rw-r-- 0 root root 0 May 13 04:27 file
Instead of relying on tar's output, let's just extract the
file using tar and stat the result using perl.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5000-tar-tree.sh | patch | blob | history |
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index fa62b6aa21f5d8f8774b7f2af3a4cd60b8c0d761..9b0baac8db4b342206d37ab5eaff0b7a09d33967 100755 (executable)
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
test_expect_success \
'validate file modification time' \
- 'TZ=GMT $TAR tvf b.tar a/a |
- awk \{print\ \$4,\ \(length\(\$5\)\<7\)\ ?\ \$5\":00\"\ :\ \$5\} \
- >b.mtime &&
- echo "2005-05-27 22:00:00" >expected.mtime &&
+ 'mkdir extract &&
+ $TAR xf b.tar -C extract a/a &&
+ perl -e '\''print((stat("extract/a/a"))[9], "\n")'\'' >b.mtime &&
+ echo "1117231200" >expected.mtime &&
diff expected.mtime b.mtime'
test_expect_success \