Skip to content

Commit

Permalink
push: always load default config
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Oct 26, 2009
1 parent 78d553b commit 2aae905
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions builtin-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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),
Expand All @@ -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)
Expand Down

0 comments on commit 2aae905

Please sign in to comment.