3 # Copyright (c) 2009 Robert Allan Zeh
5 test_description='git svn gc basic tests'
9 test_expect_success 'setup directories and test repo' '
12 echo "Sample text for Subversion repository." > import/test.txt &&
13 svn_cmd import -m "import for git svn" import "$svnrepo" > /dev/null
16 test_expect_success 'checkout working copy from svn' \
17 'svn_cmd co "$svnrepo" test_wc'
19 test_expect_success 'set some properties to create an unhandled.log file' '
22 svn_cmd propset foo bar test.txt &&
23 svn_cmd commit -m "property set"
26 test_expect_success 'Setup repo' 'git svn init "$svnrepo"'
28 test_expect_success 'Fetch repo' 'git svn fetch'
30 test_expect_success 'make backup copy of unhandled.log' '
31 cp .git/svn/refs/remotes/git-svn/unhandled.log tmp
34 test_expect_success 'create leftover index' '> .git/svn/refs/remotes/git-svn/index'
36 test_expect_success 'git svn gc runs' 'git svn gc'
38 test_expect_success 'git svn index removed' '! test -f .git/svn/refs/remotes/git-svn/index'
40 if perl -MCompress::Zlib -e 0 2>/dev/null
42 test_expect_success 'git svn gc produces a valid gzip file' '
43 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
46 say "# Perl Compress::Zlib unavailable, skipping gunzip test"
49 test_expect_success 'git svn gc does not change unhandled.log files' '
50 test_cmp .git/svn/refs/remotes/git-svn/unhandled.log tmp/unhandled.log