diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-03-16 14:13:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-03-16 14:13:25 -0700 |
commit | a0e305c2367b6aa1158bed7022083b1541cefda2 (patch) | |
tree | 33986342e2e668146e67d4d5efee19518fe4e380 | |
parent | Sync with maint (diff) | |
parent | git-svn: fix URL canonicalization during init w/ SVN 1.7+ (diff) | |
download | tgif-a0e305c2367b6aa1158bed7022083b1541cefda2.tar.xz |
Merge branch 'master' of git://bogomips.org/git-svn
* 'master' of git://bogomips.org/git-svn:
git-svn: fix URL canonicalization during init w/ SVN 1.7+
t9117: test specifying full url to git svn init -T
-rwxr-xr-x | git-svn.perl | 14 | ||||
-rwxr-xr-x | t/t9117-git-svn-init-clone.sh | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/git-svn.perl b/git-svn.perl index fa5f253065..05eced06cd 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1745,11 +1745,12 @@ sub post_fetch_checkout { sub complete_svn_url { my ($url, $path) = @_; - $path = canonicalize_path($path); - # If the path is not a URL... - if ($path !~ m#^[a-z\+]+://#) { - if (!defined $url || $url !~ m#^[a-z\+]+://#) { + if ($path =~ m#^[a-z\+]+://#i) { # path is a URL + $path = canonicalize_url($path); + } else { + $path = canonicalize_path($path); + if (!defined $url || $url !~ m#^[a-z\+]+://#i) { fatal("E: '$path' is not a complete URL ", "and a separate URL is not specified"); } @@ -1764,11 +1765,12 @@ sub complete_url_ls_init { print STDERR "W: $switch not specified\n"; return; } - $repo_path = canonicalize_path($repo_path); - if ($repo_path =~ m#^[a-z\+]+://#) { + if ($repo_path =~ m#^[a-z\+]+://#i) { + $repo_path = canonicalize_url($repo_path); $ra = Git::SVN::Ra->new($repo_path); $repo_path = ''; } else { + $repo_path = canonicalize_path($repo_path); $repo_path =~ s#^/+##; unless ($ra) { fatal("E: '$repo_path' is not a complete URL ", diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh index a66f43c6b1..69a675052e 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_success 'init with -T as a full url works' ' + test ! -d project && + git svn init -T "$svnrepo"/project/trunk project && + rm -rf project + ' + test_done |