summaryrefslogtreecommitdiff
path: root/t/t9140-git-svn-reset.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-07-19 10:08:27 (GMT)
committerEric Wong <normalperson@yhbt.net>2009-07-20 05:50:06 (GMT)
commitf0e8b1a3ed48716fa48c93f64214da1ee20ed534 (patch)
treecc6df962c0d6dc52a4f4b0f64faaa3438e7d04b0 /t/t9140-git-svn-reset.sh
parent77acc32b29990a76ac6a63d3211b7c70adcef64d (diff)
downloadgit-f0e8b1a3ed48716fa48c93f64214da1ee20ed534.zip
git-f0e8b1a3ed48716fa48c93f64214da1ee20ed534.tar.gz
git-f0e8b1a3ed48716fa48c93f64214da1ee20ed534.tar.bz2
git svn: rename tests that had conflicting numbers
Some unrelated tests were developed simultaneously and resulted in test numbers conflicting. To avoid difficulty when referring to tests via the "tXXXX" convention, rename the newer tests. Suggested by Marc Branchaud. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 't/t9140-git-svn-reset.sh')
-rwxr-xr-xt/t9140-git-svn-reset.sh66
1 files changed, 66 insertions, 0 deletions
diff --git a/t/t9140-git-svn-reset.sh b/t/t9140-git-svn-reset.sh
new file mode 100755
index 0000000..0735526
--- /dev/null
+++ b/t/t9140-git-svn-reset.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Copyright (c) 2009 Ben Jackson
+#
+
+test_description='git svn reset'
+. ./lib-git-svn.sh
+
+test_expect_success 'setup test repository' '
+ svn_cmd co "$svnrepo" s &&
+ (
+ cd s &&
+ mkdir vis &&
+ echo always visible > vis/vis.txt &&
+ svn_cmd add vis &&
+ svn_cmd commit -m "create visible files" &&
+ mkdir hid &&
+ echo initially hidden > hid/hid.txt &&
+ svn_cmd add hid &&
+ svn_cmd commit -m "create initially hidden files" &&
+ svn_cmd up &&
+ echo mod >> vis/vis.txt &&
+ svn_cmd commit -m "modify vis" &&
+ svn_cmd up
+ )
+'
+
+test_expect_success 'clone SVN repository with hidden directory' '
+ git svn init "$svnrepo" g &&
+ ( cd g && git svn fetch --ignore-paths="^hid" )
+'
+
+test_expect_success 'modify hidden file in SVN repo' '
+ ( cd s &&
+ echo mod hidden >> hid/hid.txt &&
+ svn_cmd commit -m "modify hid" &&
+ svn_cmd up
+ )
+'
+
+test_expect_success 'fetch fails on modified hidden file' '
+ ( cd g &&
+ git svn find-rev refs/remotes/git-svn > ../expect &&
+ ! git svn fetch 2> ../errors &&
+ git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
+ fgrep "not found in commit" errors &&
+ test_cmp expect expect2
+'
+
+test_expect_success 'reset unwinds back to r1' '
+ ( cd g &&
+ git svn reset -r1 &&
+ git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
+ echo 1 >expect &&
+ test_cmp expect expect2
+'
+
+test_expect_success 'refetch succeeds not ignoring any files' '
+ ( cd g &&
+ git svn fetch &&
+ git svn rebase &&
+ fgrep "mod hidden" hid/hid.txt
+ )
+'
+
+test_done