Skip to content

Commit df73af5

Browse files
Eric Wonggitster
authored andcommitted
t9143: do not fail if Compress::Zlib is missing
"git svn gc" will not compress unhandled.log files if Compress::Zlib is missing. However, leftover index files should always be removed, so add a test for this behavior as well. Signed-off-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e24c76b commit df73af5

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

t/t9143-git-svn-gc.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,20 @@ test_expect_success 'make backup copy of unhandled.log' '
3131
cp .git/svn/git-svn/unhandled.log tmp
3232
'
3333

34+
test_expect_success 'create leftover index' '> .git/svn/git-svn/index'
35+
3436
test_expect_success 'git svn gc runs' 'git svn gc'
3537

36-
test_expect_success 'git svn gc produces a valid gzip file' '
37-
gunzip .git/svn/git-svn/unhandled.log.gz
38-
'
38+
test_expect_success 'git svn index removed' '! test -f .git/svn/git-svn/index'
39+
40+
if perl -MCompress::Zlib -e 0 2>/dev/null
41+
then
42+
test_expect_success 'git svn gc produces a valid gzip file' '
43+
gunzip .git/svn/git-svn/unhandled.log.gz
44+
'
45+
else
46+
say "Perl Compress::Zlib unavailable, skipping gunzip test"
47+
fi
3948

4049
test_expect_success 'git svn gc does not change unhandled.log files' '
4150
test_cmp .git/svn/git-svn/unhandled.log tmp/unhandled.log

0 commit comments

Comments
 (0)