git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] push: always load default config

From
Jeff King <peff@peff.net>
Date
Oct 25, 2009, 19:15 UTC
Message-ID
<20091025191521.GA19014@sigio.peff.net>

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>
---
 builtin-push.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index b5cd2cd..7338176 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -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:
@@ -174,6 +173,8 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 	int rc;
 	const char *repo = NULL;	/* default repository */
 
+	git_config(git_default_config, NULL);
+
 	struct option options[] = {
 		OPT_BIT('q', "quiet", &flags, "be quiet", TRANSPORT_PUSH_QUIET),
 		OPT_BIT('v', "verbose", &flags, "be verbose", TRANSPORT_PUSH_VERBOSE),
-- 
1.6.4.2.269.g75194.dirty
Message 1 of 1 in “push: always load default config”
  1. push: always load default configJeff King, Oct 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.