From ba6485e05d43abf66e6b651a41b1ddc511b0e5eb Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 24 Sep 2008 22:44:01 +0200 Subject: 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 Signed-off-by: Shawn O. Pearce --- lib/remote.tcl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/remote.tcl') 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 +} -- cgit v1.3