diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-09-14 22:38:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-14 22:38:06 -0700 |
commit | d3392f7e86d130dfafb08736b7fa2067dd2cf070 (patch) | |
tree | 54e43a42e92e7481cb839db08eda4ef955b85e0b /git-remote.perl | |
parent | 07efafef2bcd87b35bf8880364dd5d098058cd4e (diff) | |
parent | 38944390220425cc3c4208dd31172397e7f18e8c (diff) | |
download | git-d3392f7e86d130dfafb08736b7fa2067dd2cf070.tar.gz |
Merge branch 'js/remote'
* js/remote:
Teach "git remote" a mirror mode
Diffstat (limited to 'git-remote.perl')
-rwxr-xr-x | git-remote.perl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/git-remote.perl b/git-remote.perl index 01cf480221..f6f283ea4f 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) { |