Skip to content

Commit

Permalink
git-svn: respect commiturl option for branch/tag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Igor Mironov authored and Eric Wong committed Jan 23, 2010
1 parent a83b91e commit 99bacd6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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:/;
Expand Down

0 comments on commit 99bacd6

Please sign in to comment.