3 # Copyright (c) 2009 Ben Jackson
6 test_description
='git svn reset'
9 test_expect_success
'setup test repository' '
10 svn_cmd co "$svnrepo" s &&
14 echo always visible > vis/vis.txt &&
16 svn_cmd commit -m "create visible files" &&
18 echo initially hidden > hid/hid.txt &&
20 svn_cmd commit -m "create initially hidden files" &&
22 echo mod >> vis/vis.txt &&
23 svn_cmd commit -m "modify vis" &&
28 test_expect_success
'clone SVN repository with hidden directory' '
29 git svn init "$svnrepo" g &&
30 ( cd g && git svn fetch --ignore-paths="^hid" )
33 test_expect_success
'modify hidden file in SVN repo' '
35 echo mod hidden >> hid/hid.txt &&
36 svn_cmd commit -m "modify hid" &&
41 test_expect_success
'fetch fails on modified hidden file' '
43 git svn find-rev refs/remotes/git-svn > ../expect &&
44 ! git svn fetch 2> ../errors &&
45 git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
46 fgrep "not found in commit" errors &&
47 test_cmp expect expect2
50 test_expect_success
'reset unwinds back to r1' '
53 git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
55 test_cmp expect expect2
58 test_expect_success
'refetch succeeds not ignoring any files' '
62 fgrep "mod hidden" hid/hid.txt