Skip to content

Commit 843fb91

Browse files
committed
Merge branch 'rs/empty-archive'
Fixes tests added in 1.8.2 era that are broken on BSDs. * rs/empty-archive: t5004: resurrect original empty tar archive test t5004: avoid using tar for checking emptiness of archive
2 parents 499eace + 56ee965 commit 843fb91

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

t/t5004-archive-corner-cases.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,21 @@ check_dir() {
2727
test_cmp expect actual
2828
}
2929

30+
31+
# bsdtar/libarchive versions before 3.1.3 consider a tar file with a
32+
# global pax header that is not followed by a file record as corrupt.
33+
if "$TAR" tf "$TEST_DIRECTORY"/t5004/empty-with-pax-header.tar >/dev/null 2>&1
34+
then
35+
test_set_prereq HEADER_ONLY_TAR_OK
36+
fi
37+
38+
test_expect_success HEADER_ONLY_TAR_OK 'tar archive of commit with empty tree' '
39+
git archive --format=tar HEAD >empty-with-pax-header.tar &&
40+
make_dir extract &&
41+
"$TAR" xf empty-with-pax-header.tar -C extract &&
42+
check_dir extract
43+
'
44+
3045
test_expect_success 'tar archive of empty tree is empty' '
3146
git archive --format=tar HEAD: >empty.tar &&
3247
perl -e "print \"\\0\" x 10240" >10knuls.tar &&

t/t5004/empty-with-pax-header.tar

10 KB
Binary file not shown.

0 commit comments

Comments
 (0)