X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-remote.perl;h=f6f283ea4f8b45671b7d9b34687d5d7b8475e8b3;hb=e4cd6c7a20bfc776086817671d58e09060a8079a;hp=01cf480221be1e5860bd701d5d17ced25766d38d;hpb=5071877d2c623ffc41b48bbb49908a61051a6228;p=git.git 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) {