git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
	Elijah Newren <newren@gmail.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Subject: [PATCH v2 08/13] pull: move configurations fetches
Date: Fri, 18 Dec 2020 15:10:21 -0600	[thread overview]
Message-ID: <20201218211026.1937168-9-felipe.contreras@gmail.com> (raw)
In-Reply-To: <20201218211026.1937168-1-felipe.contreras@gmail.com>

Now that we have FETCH_DEFAULT we can fetch the configuration before
parsing the argument options.

The options will override the configuration, and if they don't;
opt_rebase will remain being FETCH_DEFAULT.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 builtin/pull.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/builtin/pull.c b/builtin/pull.c
index c0a90fa741..2fd5e44e03 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -951,6 +951,9 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 	struct object_id rebase_fork_point;
 	int can_ff;
 
+	opt_ff = xstrdup_or_null(config_get_ff());
+	opt_rebase = config_get_rebase();
+
 	if (!getenv("GIT_REFLOG_ACTION"))
 		set_reflog_message(argc, argv);
 
@@ -967,12 +970,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
 
 	parse_repo_refspecs(argc, argv, &repo, &refspecs);
 
-	if (!opt_ff)
-		opt_ff = xstrdup_or_null(config_get_ff());
-
-	if (!opt_rebase)
-		opt_rebase = config_get_rebase();
-
 	if (read_cache_unmerged())
 		die_resolve_conflict("pull");
 
-- 
2.30.0.rc0


  parent reply	other threads:[~2020-12-18 21:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 21:10 [PATCH v2 00/13] pull: pull mode part 2 Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 01/13] doc: pull: explain what is a fast-forward Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 02/13] pull: improve default warning Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 03/13] pull: cleanup autostash check Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 04/13] pull: trivial cleanup Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 05/13] pull: trivial whitespace style fix Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 06/13] pull: introduce --merge option Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 07/13] rebase: add REBASE_DEFAULT Felipe Contreras
2020-12-18 21:10 ` Felipe Contreras [this message]
2020-12-18 21:10 ` [PATCH v2 09/13] pull: show warning with --ff options Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 10/13] pull: add pull.mode Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 11/13] pull: add pull.mode=fast-forward Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 12/13] pull: reorganize mode conditionals Felipe Contreras
2020-12-18 21:10 ` [PATCH v2 13/13] pull: improve --rebase and pull.rebase interaction Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201218211026.1937168-9-felipe.contreras@gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=newren@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).