summaryrefslogtreecommitdiff
path: root/lib/remote.tcl
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-25 07:27:57 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-25 08:23:09 (GMT)
commit30d1990584301132892e9f184bff9705f74a1565 (patch)
tree968ee78e182797a18ea9cf23b6396559bbe57fca /lib/remote.tcl
parent7d5266a704ea55b11799bf0431d1648282f53d54 (diff)
downloadgit-30d1990584301132892e9f184bff9705f74a1565.zip
git-30d1990584301132892e9f184bff9705f74a1565.tar.gz
git-30d1990584301132892e9f184bff9705f74a1565.tar.bz2
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>
Diffstat (limited to 'lib/remote.tcl')
-rw-r--r--lib/remote.tcl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/remote.tcl b/lib/remote.tcl
index e235ca8..cf9b9d5 100644
--- a/lib/remote.tcl
+++ b/lib/remote.tcl
@@ -57,6 +57,7 @@ proc all_tracking_branches {} {
proc load_all_remotes {} {
global repo_config
global all_remotes tracking_branches some_heads_tracking
+ global remote_url
set some_heads_tracking 0
set all_remotes [list]
@@ -76,6 +77,10 @@ proc load_all_remotes {} {
catch {
set fd [open [file join $rm_dir $name] r]
while {[gets $fd line] >= 0} {
+ if {[regexp {^URL:[ ]*(.+)$} $line line url]} {
+ set remote_url($name) $url
+ continue
+ }
if {![regexp {^Pull:[ ]*([^:]+):(.+)$} \
$line line src dst]} continue
if {[string index $src 0] eq {+}} {
@@ -100,6 +105,7 @@ proc load_all_remotes {} {
foreach line [array names repo_config remote.*.url] {
if {![regexp ^remote\.(.*)\.url\$ $line line name]} continue
lappend all_remotes $name
+ set remote_url($name) $repo_config(remote.$name.url)
if {[catch {set fl $repo_config(remote.$name.fetch)}]} {
set fl {}