diff options
author | Ramkumar Ramachandra <artagnon@gmail.com> | 2013-04-02 13:10:33 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-02 10:41:42 -0700 |
commit | 224c2171637ee71c36cb6b0ed314d14216725d6f (patch) | |
tree | 711aa2f13216d2c8676481515efa11c7ab84a676 /remote.c | |
parent | f24f715e05399cba19cb9455fdd7d8a9806fe61b (diff) | |
download | git-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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |