From 9f765ce62fd2d5159a3dc7f73abe30a3fbef08f7 Mon Sep 17 00:00:00 2001 From: Ramkumar Ramachandra Date: Tue, 2 Apr 2013 13:10:34 +0530 Subject: remote.c: introduce branch..pushremote This new configuration variable overrides `remote.pushdefault` and `branch..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 Reviewed-by: Jeff King Signed-off-by: Junio C Hamano --- remote.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'remote.c') diff --git a/remote.c b/remote.c index 6337e1183b..68eb99bdf0 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); -- cgit v1.3