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 <igor.a.mironov@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
Igor Mironov committed
Jan 12, 2010 at 03:21 UTC
99bacd6c25d30766921468d09323b2c34cf62cb8
1 file changed
+11
-1
git-svn.perl
+11
-1
@@ -708,7 +708,17 @@ sub cmd_branch {
708
}
709
}
710
my ($lft, $rgt) = @{ $glob->{path} }{qw/left right/};
711
- my $dst = join '/', $remote->{url}, $lft, $branch_name, ($rgt || ());
711
+ my $url;
712
+ if (defined $_commit_url) {
713
+ $url = $_commit_url;
714
+ } else {
715
+ $url = eval { command_oneline('config', '--get',
716
+ "svn-remote.$gs->{repo_id}.commiturl") };
717
+ if (!$url) {
718
+ $url = $remote->{url};
719
+ }
720
+ }
721
+ my $dst = join '/', $url, $lft, $branch_name, ($rgt || ());
722
723
if ($dst =~ /^https:/ && $src =~ /^http:/) {
724
$src=~s/^http:/https:/;