diff options
| author | Ulrich Dangel <uli@spamt.net> | 2009-06-26 16:52:09 +0200 | 
|---|---|---|
| committer | Eric Wong <normalperson@yhbt.net> | 2009-06-26 14:08:52 -0700 | 
| commit | 50ff23667020768fa18dcffd154406fc41ebaa84 (patch) | |
| tree | b3b14218b10678e39a6e95bb78629dac49a7ccde /git-svn.perl | |
| parent | 2317d289fefbe04fa57379fa6d115717bb25ba14 (diff) | |
| download | git-50ff23667020768fa18dcffd154406fc41ebaa84.tar.gz | |
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>
Diffstat (limited to 'git-svn.perl')
| -rwxr-xr-x | git-svn.perl | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/git-svn.perl b/git-svn.perl index 6c42e2afca..d1af1a3d2f 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(); | 
