git-svn: Canonicalize svn urls to prevent libsvn assertion
Cloning/initializing svn repositories with an uncanonicalize url does not work as libsvn throws an assertion. This patch canonicalize svn uris for the clone and init command from git-svn. [ew: fixed trailing whitespace] Signed-off-by: Ulrich Dangel <uli@spamt.net> Acked-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
parent
2317d289fe
commit
50ff236670
@ -389,6 +389,7 @@ sub cmd_init {
|
|||||||
}
|
}
|
||||||
my $url = shift or die "SVN repository location required ",
|
my $url = shift or die "SVN repository location required ",
|
||||||
"as a command-line argument\n";
|
"as a command-line argument\n";
|
||||||
|
$url = canonicalize_url($url);
|
||||||
init_subdir(@_);
|
init_subdir(@_);
|
||||||
do_git_init_db();
|
do_git_init_db();
|
||||||
|
|
||||||
@ -806,6 +807,12 @@ sub canonicalize_path {
|
|||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub canonicalize_url {
|
||||||
|
my ($url) = @_;
|
||||||
|
$url =~ s#^([^:]+://[^/]*/)(.*)$#$1 . canonicalize_path($2)#e;
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
|
|
||||||
# get_svnprops(PATH)
|
# get_svnprops(PATH)
|
||||||
# ------------------
|
# ------------------
|
||||||
# Helper for cmd_propget and cmd_proplist below.
|
# Helper for cmd_propget and cmd_proplist below.
|
||||||
@ -875,7 +882,7 @@ sub cmd_multi_init {
|
|||||||
|
|
||||||
$_prefix = '' unless defined $_prefix;
|
$_prefix = '' unless defined $_prefix;
|
||||||
if (defined $url) {
|
if (defined $url) {
|
||||||
$url =~ s#/+$##;
|
$url = canonicalize_url($url);
|
||||||
init_subdir(@_);
|
init_subdir(@_);
|
||||||
}
|
}
|
||||||
do_git_init_db();
|
do_git_init_db();
|
||||||
|
Loading…
Reference in New Issue
Block a user