aboutsummaryrefslogtreecommitdiff
path: root/git-remote.perl
diff options
context:
space:
mode:
Diffstat (limited to 'git-remote.perl')
-rwxr-xr-xgit-remote.perl8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-remote.perl b/git-remote.perl
index 01cf48022..f6f283ea4 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -278,7 +278,9 @@ sub add_remote {
for (@$track) {
$git->command('config', '--add', "remote.$name.fetch",
- "+refs/heads/$_:refs/remotes/$name/$_");
+ $opts->{'mirror'} ?
+ "+refs/$_:refs/$_" :
+ "+refs/heads/$_:refs/remotes/$name/$_");
}
if ($opts->{'fetch'}) {
$git->command('fetch', $name);
@@ -409,6 +411,10 @@ elsif ($ARGV[0] eq 'add') {
shift @ARGV;
next;
}
+ if ($opt eq '--mirror') {
+ $opts{'mirror'} = 1;
+ next;
+ }
add_usage();
}
if (@ARGV != 3) {