summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Burton <markb@ordern.com>2008-12-02 15:15:02 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-12-02 15:20:19 (GMT)
commit861c68e3b6a8d10af5517e6750a66407d32105aa (patch)
tree3bc7c4de922e7ad9662228b834fb3cca9afd39e9 /lib
parent6249067c614f9c190a5261bb95c5a9a3a41ef039 (diff)
downloadgit-861c68e3b6a8d10af5517e6750a66407d32105aa.zip
git-861c68e3b6a8d10af5517e6750a66407d32105aa.tar.gz
git-861c68e3b6a8d10af5517e6750a66407d32105aa.tar.bz2
git-gui: Teach start_push_anywhere_action{} to notice when remote is a mirror.
When the destination repository is a mirror, this function goofed by still passing a refspec to git-push. Now it notices that the remote is a mirror and holds the refspec. Signed-off-by: Mark Burton <markb@ordern.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/transport.tcl43
1 files changed, 27 insertions, 16 deletions
diff --git a/lib/transport.tcl b/lib/transport.tcl
index e419d78..b18d9c7 100644
--- a/lib/transport.tcl
+++ b/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
}