summaryrefslogtreecommitdiff
path: root/lib/remote.tcl
diff options
context:
space:
mode:
authorLibravatar Petr Baudis <pasky@suse.cz>2008-09-24 22:44:01 +0200
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2008-09-30 12:59:18 -0700
commitba6485e05d43abf66e6b651a41b1ddc511b0e5eb (patch)
treef7519a2886c0b2cf48594ca3a6e8b85886ef3a64 /lib/remote.tcl
parentgit-gui: Squash populate_{push,fetch}_menu to populate_remotes_menu (diff)
downloadtgif-ba6485e05d43abf66e6b651a41b1ddc511b0e5eb.tar.xz
git-gui: Add support for adding remotes
When a remote is being added, it can also be automatically either fetched or initialized and pushed; this patch adds capability for initializing of local and ssh repositories. This also of course leaves a lot of space for further customization features, like individually turning the initialization phase on/off or tuning attributes of the remote repository; I consider that out of scope of this patch, however. Signed-off-by: Petr Baudis <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib/remote.tcl')
-rw-r--r--lib/remote.tcl15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/remote.tcl b/lib/remote.tcl
index d97c851110..643f0bc543 100644
--- a/lib/remote.tcl
+++ b/lib/remote.tcl
@@ -221,3 +221,18 @@ proc populate_remotes_menu {} {
add_push_entry $r
}
}
+
+proc add_single_remote {name location} {
+ global all_remotes repo_config
+ lappend all_remotes $name
+
+ git remote add $name $location
+
+ # XXX: Better re-read the config so that we will never get out
+ # of sync with git remote implementation?
+ set repo_config(remote.$name.url) $location
+ set repo_config(remote.$name.fetch) "+refs/heads/*:refs/remotes/$name/*"
+
+ add_fetch_entry $name
+ add_push_entry $name
+}