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>
This commit is contained in:

committed by
Junio C Hamano

parent
224c217163
commit
9f765ce62f
4
remote.c
4
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);
|
||||
|
Reference in New Issue
Block a user