summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-04-02 13:10:33 +0530
committerJunio C Hamano <gitster@pobox.com>2013-04-02 10:41:42 -0700
commit224c2171637ee71c36cb6b0ed314d14216725d6f (patch)
tree711aa2f13216d2c8676481515efa11c7ab84a676 /remote.c
parentf24f715e05399cba19cb9455fdd7d8a9806fe61b (diff)
downloadgit-224c2171637ee71c36cb6b0ed314d14216725d6f.tar.gz
remote.c: introduce remote.pushdefault
This new configuration variable defines the default remote to push to, and overrides `branch.<name>.remote` for all branches. It is useful in the typical triangular-workflow setup, where the remote you're fetching from is different from the remote you're pushing to. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index 2b06e222a4..6337e1183b 100644
--- a/remote.c
+++ b/remote.c
@@ -389,9 +389,16 @@ static int handle_config(const char *key, const char *value, void *cb)
add_instead_of(rewrite, xstrdup(value));
}
}
+
if (prefixcmp(key, "remote."))
return 0;
name = key + 7;
+
+ /* Handle remote.* variables */
+ if (!strcmp(name, "pushdefault"))
+ return git_config_string(&pushremote_name, key, value);
+
+ /* Handle remote.<name>.* variables */
if (*name == '/') {
warning("Config remote shorthand cannot begin with '/': %s",
name);