summaryrefslogtreecommitdiff
path: root/t/t5000-tar-tree.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-05-13 08:45:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-05-14 04:45:28 (GMT)
commit30684dfaf8cf96e5afc01668acc01acc0ade59db (patch)
tree2b9ef28561b52ffa470a1084d4f796a2c0fc6b80 /t/t5000-tar-tree.sh
parentbbf08124e0a87658a76b53a05d67227fa3b4e7b9 (diff)
downloadgit-30684dfaf8cf96e5afc01668acc01acc0ade59db.zip
git-30684dfaf8cf96e5afc01668acc01acc0ade59db.tar.gz
git-30684dfaf8cf96e5afc01668acc01acc0ade59db.tar.bz2
t5000: tar portability fix
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>
Diffstat (limited to 't/t5000-tar-tree.sh')
-rwxr-xr-xt/t5000-tar-tree.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index fa62b6a..9b0baac 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -67,10 +67,10 @@ test_expect_success \
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 \