@matheusbsbs / matheus-bagliano / commits / 2aae905f23
Fork 0

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>

Jeff King committed Oct 25, 2009 at 15:15 UTC 2aae905f23f79f004625346d057e5be7a81dbcd4
1 file changed +1 -2
builtin-push.c
+1 -2
@@ -66,7 +66,6 @@ static void setup_push_tracking(void)
66
67 static void setup_default_push_refspecs(void)
68 {
69 - git_config(git_default_config, NULL);
69 switch (push_default) {
70 default:
71 case PUSH_DEFAULT_MATCHING:
@@ -173,7 +172,6 @@ int cmd_push(int argc, const char **argv, const char *prefix)
172 int tags = 0;
173 int rc;
174 const char *repo = NULL; /* default repository */
176 -
175 struct option options[] = {
176 OPT_BIT('q', "quiet", &flags, "be quiet", TRANSPORT_PUSH_QUIET),
177 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)
189 OPT_END()
190 };
191
192 + git_config(git_default_config, NULL);
193 argc = parse_options(argc, argv, prefix, options, push_usage, 0);
194
195 if (tags)