1
0
mirror of https://github.com/git/git.git synced 2024-09-29 15:31:53 +02:00

push: always load default config

This is needed because we want to use the
advice.pushnonfastforward variable.

Previously, we would load the config on demand only when we
needed to look at push.default.  Which meant that "git push"
would load it, but "git push remote" would not, leading to
differing behavior.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King 2009-10-25 15:15:22 -04:00 committed by Junio C Hamano
parent 78d553b7d7
commit 2aae905f23

@ -66,7 +66,6 @@ static void setup_push_tracking(void)
static void setup_default_push_refspecs(void)
{
git_config(git_default_config, NULL);
switch (push_default) {
default:
case PUSH_DEFAULT_MATCHING:
@ -173,7 +172,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
int tags = 0;
int rc;
const char *repo = NULL; /* default repository */
struct option options[] = {
OPT_BIT('q', "quiet", &flags, "be quiet", TRANSPORT_PUSH_QUIET),
OPT_BIT('v', "verbose", &flags, "be verbose", TRANSPORT_PUSH_VERBOSE),
@ -191,6 +189,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
OPT_END()
};
git_config(git_default_config, NULL);
argc = parse_options(argc, argv, prefix, options, push_usage, 0);
if (tags)