Skip to content

Commit a0e305c

Browse files
committed
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
2 parents 3f97853 + b557165 commit a0e305c

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

git-svn.perl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,11 +1745,12 @@ sub post_fetch_checkout {
17451745

17461746
sub complete_svn_url {
17471747
my ($url, $path) = @_;
1748-
$path = canonicalize_path($path);
17491748

1750-
# If the path is not a URL...
1751-
if ($path !~ m#^[a-z\+]+://#) {
1752-
if (!defined $url || $url !~ m#^[a-z\+]+://#) {
1749+
if ($path =~ m#^[a-z\+]+://#i) { # path is a URL
1750+
$path = canonicalize_url($path);
1751+
} else {
1752+
$path = canonicalize_path($path);
1753+
if (!defined $url || $url !~ m#^[a-z\+]+://#i) {
17531754
fatal("E: '$path' is not a complete URL ",
17541755
"and a separate URL is not specified");
17551756
}
@@ -1764,11 +1765,12 @@ sub complete_url_ls_init {
17641765
print STDERR "W: $switch not specified\n";
17651766
return;
17661767
}
1767-
$repo_path = canonicalize_path($repo_path);
1768-
if ($repo_path =~ m#^[a-z\+]+://#) {
1768+
if ($repo_path =~ m#^[a-z\+]+://#i) {
1769+
$repo_path = canonicalize_url($repo_path);
17691770
$ra = Git::SVN::Ra->new($repo_path);
17701771
$repo_path = '';
17711772
} else {
1773+
$repo_path = canonicalize_path($repo_path);
17721774
$repo_path =~ s#^/+##;
17731775
unless ($ra) {
17741776
fatal("E: '$repo_path' is not a complete URL ",

t/t9117-git-svn-init-clone.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,10 @@ test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' '
119119
rm -f warning
120120
'
121121

122+
test_expect_success 'init with -T as a full url works' '
123+
test ! -d project &&
124+
git svn init -T "$svnrepo"/project/trunk project &&
125+
rm -rf project
126+
'
127+
122128
test_done

0 commit comments

Comments
 (0)