git-svn: respect commiturl option for branch/tag
[gitweb.git] / git-svn.perl
index e05bf366cc1946375be5d9dc91de4f38a0b31540..2e14b22c899105bbd97eaf01c2d2dc1b6b6a9144 100755 (executable)
@@ -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:/;