summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorIgor Mironov <igor.a.mironov@gmail.com>2010-01-11 16:21:23 (GMT)
committerEric Wong <normalperson@yhbt.net>2010-01-23 11:23:03 (GMT)
commit99bacd6c25d30766921468d09323b2c34cf62cb8 (patch)
treec5f3d27c439df2ae36a4b32817be5e8295c9d3ee /git-svn.perl
parenta83b91e7246fed3df5686c29a3c64eed8670fd98 (diff)
downloadgit-99bacd6c25d30766921468d09323b2c34cf62cb8.zip
git-99bacd6c25d30766921468d09323b2c34cf62cb8.tar.gz
git-99bacd6c25d30766921468d09323b2c34cf62cb8.tar.bz2
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>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl12
1 files changed, 11 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index e05bf36..2e14b22 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:/;