]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9143-git-svn-gc.sh
Makefile: Include subdirectories in "make cover" reports
[thirdparty/git.git] / t / t9143-git-svn-gc.sh
CommitLineData
2da9ee08
RZ
1#!/bin/sh
2#
3# Copyright (c) 2009 Robert Allan Zeh
4
5test_description='git svn gc basic tests'
6
7. ./lib-git-svn.sh
8
9test_expect_success 'setup directories and test repo' '
10 mkdir import &&
11 mkdir tmp &&
12 echo "Sample text for Subversion repository." > import/test.txt &&
13 svn_cmd import -m "import for git svn" import "$svnrepo" > /dev/null
14 '
15
16test_expect_success 'checkout working copy from svn' \
17 'svn_cmd co "$svnrepo" test_wc'
18
19test_expect_success 'set some properties to create an unhandled.log file' '
20 (
21 cd test_wc &&
22 svn_cmd propset foo bar test.txt &&
23 svn_cmd commit -m "property set"
24 )'
25
26test_expect_success 'Setup repo' 'git svn init "$svnrepo"'
27
28test_expect_success 'Fetch repo' 'git svn fetch'
29
30test_expect_success 'make backup copy of unhandled.log' '
6f5748e1 31 cp .git/svn/refs/remotes/git-svn/unhandled.log tmp
2da9ee08
RZ
32 '
33
6f5748e1 34test_expect_success 'create leftover index' '> .git/svn/refs/remotes/git-svn/index'
df73af5f 35
2da9ee08
RZ
36test_expect_success 'git svn gc runs' 'git svn gc'
37
6f5748e1 38test_expect_success 'git svn index removed' '! test -f .git/svn/refs/remotes/git-svn/index'
df73af5f
EW
39
40if perl -MCompress::Zlib -e 0 2>/dev/null
41then
42 test_expect_success 'git svn gc produces a valid gzip file' '
6f5748e1 43 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
df73af5f
EW
44 '
45else
fadb5156 46 say "# Perl Compress::Zlib unavailable, skipping gunzip test"
df73af5f 47fi
2da9ee08
RZ
48
49test_expect_success 'git svn gc does not change unhandled.log files' '
6f5748e1 50 test_cmp .git/svn/refs/remotes/git-svn/unhandled.log tmp/unhandled.log
2da9ee08
RZ
51 '
52
53test_done