pull: fix cli and config option parsing order
pull parses first the cli options and then the config option. The expected behavior is the other way around, so that config options can not override the cli ones. This patch changes the parsing order so config options are parsed first. Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nicolas Morey-Chaisemartin committed
Sep 6, 2017 at 08:48 UTC
cad0c6928eae87dc8619b035e4eced5f2c662a12
1 file changed
+2
-2
builtin/pull.c
+2
-2
@@ -815,6 +815,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
815
if (!getenv("GIT_REFLOG_ACTION"))
816
set_reflog_message(argc, argv);
817
818
+ git_config(git_pull_config, NULL);
819
+
820
argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0);
821
822
parse_repo_refspecs(argc, argv, &repo, &refspecs);
@@ -825,8 +827,6 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
827
if (opt_rebase < 0)
828
opt_rebase = config_get_rebase();
829
828
- git_config(git_pull_config, NULL);
829
-
830
if (read_cache_unmerged())
831
die_resolve_conflict("pull");
832