From: Igor Mironov Date: Mon, 11 Jan 2010 16:21:23 +0000 (+1100) Subject: git-svn: respect commiturl option for branch/tag X-Git-Tag: v1.7.0-rc0~11^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=99bacd6c25d30766921468d09323b2c34cf62cb8;p=git.git git-svn: respect commiturl option for branch/tag When constructing a destination URL, use the property 'commiturl' if it is specified in the configuration file; otherwise take 'url' as usual. This accommodates the scenario where a user only wants to involve the writable repository in operations performing a commit and defaults everything else to a read-only URL. [ew: shortened subject] Signed-off-by: Igor Mironov Acked-by: Eric Wong --- diff --git a/git-svn.perl b/git-svn.perl index e05bf366c..2e14b22c8 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -708,7 +708,17 @@ sub cmd_branch { } } my ($lft, $rgt) = @{ $glob->{path} }{qw/left right/}; - my $dst = join '/', $remote->{url}, $lft, $branch_name, ($rgt || ()); + my $url; + if (defined $_commit_url) { + $url = $_commit_url; + } else { + $url = eval { command_oneline('config', '--get', + "svn-remote.$gs->{repo_id}.commiturl") }; + if (!$url) { + $url = $remote->{url}; + } + } + my $dst = join '/', $url, $lft, $branch_name, ($rgt || ()); if ($dst =~ /^https:/ && $src =~ /^http:/) { $src=~s/^http:/https:/;