[PATCH] t9143: do not fail if Compress::Zlib is missing
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Jul 26, 2009, 10:01 UTC
- Message-ID
- <20090726100152.GA25775@dcvr.yhbt.net>
- In-Reply-To
- <7v3a8jsvyu.fsf@alter.siamese.dyndns.org>
"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 <normalperson@yhbt.net> --- Junio C Hamano <gitster@pobox.com> wrote: > Eric Wong <normalperson@yhbt.net> writes: > > > # I thought I had pushed this out earlier: > > Robert Allan Zeh (1): > > git svn: add gc command > > Note that with this commit, the test fails needlessly if Compress::Zlib is > not found, even though otherwise "svn gc" succeeds (for some definition of > "success")..
Oops, this test completely slipped my mind even though I caught the issue in the original code. Pushed out to git://git.bogomips.org/git-svn
t/t9143-git-svn-gc.sh | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh index aaa3af0..f2ba2d1 100755 --- a/t/t9143-git-svn-gc.sh +++ b/t/t9143-git-svn-gc.sh @@ -31,11 +31,20 @@ test_expect_success 'make backup copy of unhandled.log' ' cp .git/svn/git-svn/unhandled.log tmp ' +test_expect_success 'create leftover index' '> .git/svn/git-svn/index' + test_expect_success 'git svn gc runs' 'git svn gc' -test_expect_success 'git svn gc produces a valid gzip file' ' - gunzip .git/svn/git-svn/unhandled.log.gz - ' +test_expect_success 'git svn index removed' '! test -f .git/svn/git-svn/index' + +if perl -MCompress::Zlib -e 0 2>/dev/null +then + test_expect_success 'git svn gc produces a valid gzip file' ' + gunzip .git/svn/git-svn/unhandled.log.gz + ' +else + say "Perl Compress::Zlib unavailable, skipping gunzip test" +fi test_expect_success 'git svn gc does not change unhandled.log files' ' test_cmp .git/svn/git-svn/unhandled.log tmp/unhandled.log
-- Eric Wong