From: Ulrich Dangel Date: Fri, 26 Jun 2009 14:52:09 +0000 (+0200) Subject: git-svn: Canonicalize svn urls to prevent libsvn assertion X-Git-Tag: v1.6.4-rc0~36^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=50ff23667020768fa18dcffd154406fc41ebaa84;p=git.git 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 Acked-by: Eric Wong --- diff --git a/git-svn.perl b/git-svn.perl index 6c42e2afc..d1af1a3d2 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -389,6 +389,7 @@ sub cmd_init { } my $url = shift or die "SVN repository location required ", "as a command-line argument\n"; + $url = canonicalize_url($url); init_subdir(@_); do_git_init_db(); @@ -806,6 +807,12 @@ sub canonicalize_path { return $path; } +sub canonicalize_url { + my ($url) = @_; + $url =~ s#^([^:]+://[^/]*/)(.*)$#$1 . canonicalize_path($2)#e; + return $url; +} + # get_svnprops(PATH) # ------------------ # Helper for cmd_propget and cmd_proplist below. @@ -875,7 +882,7 @@ sub cmd_multi_init { $_prefix = '' unless defined $_prefix; if (defined $url) { - $url =~ s#/+$##; + $url = canonicalize_url($url); init_subdir(@_); } do_git_init_db();