@matheusbsbs / matheus-bagliano / commits / 30d1990584
Fork 0

git-gui: Save remote urls obtained from config/remotes setup

I'm storing the URLs of any pre-configured remote repositories that we happen to come across so that we can later use these URLs to show to the user in parts of the UI that might care. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jul 25, 2007 at 03:27 UTC 30d1990584301132892e9f184bff9705f74a1565
1 file changed +6
lib/remote.tcl
+6
@@ -57,6 +57,7 @@ proc all_tracking_branches {} {
57 proc load_all_remotes {} {
58 global repo_config
59 global all_remotes tracking_branches some_heads_tracking
60 + global remote_url
61
62 set some_heads_tracking 0
63 set all_remotes [list]
@@ -76,6 +77,10 @@ proc load_all_remotes {} {
77 catch {
78 set fd [open [file join $rm_dir $name] r]
79 while {[gets $fd line] >= 0} {
80 + if {[regexp {^URL:[ ]*(.+)$} $line line url]} {
81 + set remote_url($name) $url
82 + continue
83 + }
84 if {![regexp {^Pull:[ ]*([^:]+):(.+)$} \
85 $line line src dst]} continue
86 if {[string index $src 0] eq {+}} {
@@ -100,6 +105,7 @@ proc load_all_remotes {} {
105 foreach line [array names repo_config remote.*.url] {
106 if {![regexp ^remote\.(.*)\.url\$ $line line name]} continue
107 lappend all_remotes $name
108 + set remote_url($name) $repo_config(remote.$name.url)
109
110 if {[catch {set fl $repo_config(remote.$name.fetch)}]} {
111 set fl {}