git-update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
git-commit-tree $treeid </dev/null)'
+test_expect_success \
+ 'git-archive' \
+ 'git-archive HEAD >b.tar'
+
test_expect_success \
'git-tar-tree' \
- 'git-tar-tree HEAD >b.tar'
+ 'git-tar-tree HEAD >b2.tar'
+
+test_expect_success \
+ 'git-archive vs. git-tar-tree' \
+ 'diff b.tar b2.tar'
test_expect_success \
'validate file modification time' \
'git-archive --format=zip' \
'git-archive --format=zip HEAD >d.zip'
+$UNZIP -v 2>/dev/null
+if [ $? -eq 127 ]; then
+ echo "Skipping ZIP tests, because unzip was not found"
+ test_done
+ exit
+fi
+
test_expect_success \
'extract ZIP archive' \
'(mkdir d && cd d && $UNZIP ../d.zip)'
'validate file contents with prefix' \
'diff -r a e/prefix/a'
+test_expect_success \
+ 'git-archive --list outside of a git repo' \
+ 'GIT_DIR=some/non-existing/directory git-archive --list'
+
test_done