Skip to content

Commit 2aae905

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 78d553b commit 2aae905

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin-push.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ static void setup_push_tracking(void)
6666

6767
static void setup_default_push_refspecs(void)
6868
{
69-
git_config(git_default_config, NULL);
7069
switch (push_default) {
7170
default:
7271
case PUSH_DEFAULT_MATCHING:
@@ -173,7 +172,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
173172
int tags = 0;
174173
int rc;
175174
const char *repo = NULL; /* default repository */
176-
177175
struct option options[] = {
178176
OPT_BIT('q', "quiet", &flags, "be quiet", TRANSPORT_PUSH_QUIET),
179177
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)
191189
OPT_END()
192190
};
193191

192+
git_config(git_default_config, NULL);
194193
argc = parse_options(argc, argv, prefix, options, push_usage, 0);
195194

196195
if (tags)

0 commit comments

Comments
 (0)