X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-gui%2Flib%2Ftransport.tcl;h=b18d9c7a1b0b2d8f370ecd8c4cdf6ac1a4586c51;hb=f0817310903312bbc243dd80f066e17a8e0e4b1d;hp=e419d7810ae404e41a0a85080d16f4576d737d8a;hpb=47577456bfe61c32df73a7cf4a388f007af3b18f;p=git.git diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl index e419d7810..b18d9c7a1 100644 --- a/git-gui/lib/transport.tcl +++ b/git-gui/lib/transport.tcl @@ -33,10 +33,15 @@ proc push_to {remote} { proc start_push_anywhere_action {w} { global push_urltype push_remote push_url push_thin push_tags global push_force + global repo_config + set is_mirror 0 set r_url {} switch -- $push_urltype { - remote {set r_url $push_remote} + remote { + set r_url $push_remote + catch {set is_mirror $repo_config(remote.$push_remote.mirror)} + } url {set r_url $push_url} } if {$r_url eq {}} return @@ -53,23 +58,29 @@ proc start_push_anywhere_action {w} { lappend cmd --tags } lappend cmd $r_url - set cnt 0 - foreach i [$w.source.l curselection] { - set b [$w.source.l get $i] - lappend cmd "refs/heads/$b:refs/heads/$b" - incr cnt - } - if {$cnt == 0} { - return - } elseif {$cnt == 1} { - set unit branch + if {$is_mirror} { + set cons [console::new \ + [mc "push %s" $r_url] \ + [mc "Mirroring to %s" $r_url]] } else { - set unit branches - } + set cnt 0 + foreach i [$w.source.l curselection] { + set b [$w.source.l get $i] + lappend cmd "refs/heads/$b:refs/heads/$b" + incr cnt + } + if {$cnt == 0} { + return + } elseif {$cnt == 1} { + set unit branch + } else { + set unit branches + } - set cons [console::new \ - [mc "push %s" $r_url] \ - [mc "Pushing %s %s to %s" $cnt $unit $r_url]] + set cons [console::new \ + [mc "push %s" $r_url] \ + [mc "Pushing %s %s to %s" $cnt $unit $r_url]] + } console::exec $cons $cmd destroy $w }