From 4be4d550635d25a5050c3539f8ad3be44dabfce9 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Wed, 16 Mar 2016 19:09:54 +0000 Subject: t9117: test specifying full url to git svn init -T According to the documentation, full URLs can be specified in the `-T` argument to `git svn init`. However, the canonicalization of such arguments squashes together consecutive "/"s, which unsurprisingly breaks http://, svn://, etc URLs. Add a failing test case to provide evidence of that. On systems where Subversion provides svn_path_canonicalize but not svn_dirent_canonicalize (Subversion 1.6 and earlier?), this test passes, as svn_path_canonicalize doesn't mangle the consecutive "/"s. [ew: fixed whitespace] Signed-off-by: Adam Dinwoodie Signed-off-by: Eric Wong --- t/t9117-git-svn-init-clone.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't') diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh index a66f43c6b1..2ba003d4b0 100755 --- a/t/t9117-git-svn-init-clone.sh +++ b/t/t9117-git-svn-init-clone.sh @@ -119,4 +119,10 @@ test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' ' rm -f warning ' +test_expect_failure 'init with -T as a full url works' ' + test ! -d project && + git svn init -T "$svnrepo"/project/trunk project && + rm -rf project + ' + test_done -- cgit v1.2.3 From b557165311f7ed1b94d94a74e7ea3a6e76bbbe88 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 16 Mar 2016 20:14:08 +0000 Subject: git-svn: fix URL canonicalization during init w/ SVN 1.7+ URL canonicalization when full URLs are passed became broken when using SVN::_Core::svn_dirent_canonicalize under SVN 1.7. Ensure we canonicalize paths and URLs with appropriate functions for each type from now on as the path/URL-agnostic SVN::_Core::svn_path_canonicalize function is deprecated in SVN. Tested with the following commands: git svn init -T svn://svn.code.sf.net/p/squirrelmail/code/trunk git svn init -b svn://svn.code.sf.net/p/squirrelmail/code/branches Reported-by: Adam Dinwoodie http://mid.gmane.org/20160315162344.GM29016@dinwoodie.org Signed-off-by: Eric Wong --- t/t9117-git-svn-init-clone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh index 2ba003d4b0..69a675052e 100755 --- a/t/t9117-git-svn-init-clone.sh +++ b/t/t9117-git-svn-init-clone.sh @@ -119,7 +119,7 @@ test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' ' rm -f warning ' -test_expect_failure 'init with -T as a full url works' ' +test_expect_success 'init with -T as a full url works' ' test ! -d project && git svn init -T "$svnrepo"/project/trunk project && rm -rf project -- cgit v1.2.3