aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-18 14:04:16 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-18 14:04:16 -0700
commit4097a25429d09b61616845fbe6551587a30fa038 (patch)
tree794750558aeafd79dcc29b230992d2d37a1d9d62 /remote.c
parent8aac6c97e81dee53ae7740663128b0296398d6d1 (diff)
parent98b406f3ad6a6989a5b11c2a2582a9f539d66263 (diff)
downloadgit-4097a25429d09b61616845fbe6551587a30fa038.tar.gz
git-4097a25429d09b61616845fbe6551587a30fa038.tar.xz
Merge branch 'jk/remote-pushremote-config-reading' into maint
"git push" did not pay attention to branch.*.pushremote if it is defined earlier than remote.pushdefault; the order of these two variables in the configuration file should not matter, but it did by mistake. * jk/remote-pushremote-config-reading: remote: handle pushremote config in any order
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index e41251ee7..5f63d5505 100644
--- a/remote.c
+++ b/remote.c
@@ -49,6 +49,7 @@ static int branches_nr;
static struct branch *current_branch;
static const char *default_remote_name;
+static const char *branch_pushremote_name;
static const char *pushremote_name;
static int explicit_default_remote_name;
@@ -352,7 +353,7 @@ static int handle_config(const char *key, const char *value, void *cb)
}
} else if (!strcmp(subkey, ".pushremote")) {
if (branch == current_branch)
- if (git_config_string(&pushremote_name, key, value))
+ if (git_config_string(&branch_pushremote_name, key, value))
return -1;
} else if (!strcmp(subkey, ".merge")) {
if (!value)
@@ -492,6 +493,10 @@ static void read_config(void)
make_branch(head_ref + strlen("refs/heads/"), 0);
}
git_config(handle_config, NULL);
+ if (branch_pushremote_name) {
+ free((char *)pushremote_name);
+ pushremote_name = branch_pushremote_name;
+ }
alias_all_urls();
}