Code

Merge branch 'cb/match_refs_internal_tail'
[git.git] / t / lib-git-svn.sh
index cdd7ccdd2ac87e27bd6912e92477e986517c32ad..56549623430ca6bea2de35bbae7d2d211720da3b 100644 (file)
@@ -8,6 +8,10 @@ then
        say 'skipping git svn tests, NO_SVN_TESTS defined'
        test_done
 fi
+if ! test_have_prereq PERL; then
+       say 'skipping git svn tests, perl not available'
+       test_done
+fi
 
 GIT_DIR=$PWD/.git
 GIT_SVN_DIR=$GIT_DIR/svn/git-svn
@@ -22,6 +26,8 @@ fi
 
 svnrepo=$PWD/svnrepo
 export svnrepo
+svnconf=$PWD/svnconf
+export svnconf
 
 perl -w -e "
 use SVN::Core;
@@ -50,6 +56,19 @@ poke() {
        test-chmtime +1 "$1"
 }
 
+# We need this, because we should pass empty configuration directory to
+# the 'svn commit' to avoid automated property changes and other stuff
+# that could be set from user's configuration files in ~/.subversion.
+svn_cmd () {
+       [ -d "$svnconf" ] || mkdir "$svnconf"
+       orig_svncmd="$1"; shift
+       if [ -z "$orig_svncmd" ]; then
+               svn
+               return
+       fi
+       svn "$orig_svncmd" --config-dir "$svnconf" "$@"
+}
+
 for d in \
        "$SVN_HTTPD_PATH" \
        /usr/sbin/apache2 \