summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-04-02 07:40:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-02 17:41:43 (GMT)
commit9f765ce62fd2d5159a3dc7f73abe30a3fbef08f7 (patch)
tree6089127d40be35383ea9aa4e31b21f29016a2ef6 /remote.c
parent224c2171637ee71c36cb6b0ed314d14216725d6f (diff)
downloadgit-9f765ce62fd2d5159a3dc7f73abe30a3fbef08f7.zip
git-9f765ce62fd2d5159a3dc7f73abe30a3fbef08f7.tar.gz
git-9f765ce62fd2d5159a3dc7f73abe30a3fbef08f7.tar.bz2
remote.c: introduce branch.<name>.pushremote
This new configuration variable overrides `remote.pushdefault` and `branch.<name>.remote` for pushes. When you pull from one place (e.g. your upstream) and push to another place (e.g. your own publishing repository), you would want to set `remote.pushdefault` to specify the remote to push to for all branches, and use this option to override it for a specific branch. 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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index 6337e11..68eb99b 100644
--- a/remote.c
+++ b/remote.c
@@ -364,6 +364,10 @@ static int handle_config(const char *key, const char *value, void *cb)
default_remote_name = branch->remote_name;
explicit_default_remote_name = 1;
}
+ } else if (!strcmp(subkey, ".pushremote")) {
+ if (branch == current_branch)
+ if (git_config_string(&pushremote_name, key, value))
+ return -1;
} else if (!strcmp(subkey, ".merge")) {
if (!value)
return config_error_nonbool(key);