]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pull: don't warn if pull.ff has been set
authorAlex Henrie <alexhenrie24@gmail.com>
Fri, 25 Sep 2020 03:50:23 +0000 (21:50 -0600)
committerJunio C Hamano <gitster@pobox.com>
Fri, 25 Sep 2020 06:04:27 +0000 (23:04 -0700)
A user who understands enough to set pull.ff does not need additional
instructions.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pull.c
t/t7601-merge-pull-config.sh

index 00e5857a8d18da3394d6e5a3316e8f56bb98fdb5..0f71eca4685a48c219b3c99447c381df6953a303 100644 (file)
@@ -344,8 +344,7 @@ static enum rebase_type config_get_rebase(void)
        if (!git_config_get_value("pull.rebase", &value))
                return parse_config_rebase("pull.rebase", value, 1);
 
-       if (opt_verbosity >= 0 &&
-           (!opt_ff || strcmp(opt_ff, "--ff-only"))) {
+       if (opt_verbosity >= 0 && !opt_ff) {
                warning(_("Pulling without specifying how to reconcile divergent branches is\n"
                        "discouraged. You can squelch this message by running one of the following\n"
                        "commands sometime before your next pull:\n"
index 0f97828cd0bb8e6c3f1c39332010f5fbcfdb6512..c5c4ea5fc09e335b41e021f04206c4328326c811 100755 (executable)
@@ -33,11 +33,18 @@ test_expect_success 'pull.rebase not set' '
        test_i18ngrep "Pulling without specifying how to reconcile" err
 '
 
+test_expect_success 'pull.rebase not set and pull.ff=true' '
+       git reset --hard c0 &&
+       test_config pull.ff true &&
+       git pull . c1 2>err &&
+       test_i18ngrep ! "Pulling without specifying how to reconcile" err
+'
+
 test_expect_success 'pull.rebase not set and pull.ff=false' '
        git reset --hard c0 &&
        test_config pull.ff false &&
        git pull . c1 2>err &&
-       test_i18ngrep "Pulling without specifying how to reconcile" err
+       test_i18ngrep "Pulling without specifying how to reconcile" err
 '
 
 test_expect_success 'pull.rebase not set and pull.ff=only' '
@@ -59,6 +66,18 @@ test_expect_success 'pull.rebase not set and --no-rebase given' '
        test_i18ngrep ! "Pulling without specifying how to reconcile" err
 '
 
+test_expect_success 'pull.rebase not set and --ff given' '
+       git reset --hard c0 &&
+       git pull --ff . c1 2>err &&
+       test_i18ngrep ! "Pulling without specifying how to reconcile" err
+'
+
+test_expect_success 'pull.rebase not set and --no-ff given' '
+       git reset --hard c0 &&
+       git pull --no-ff . c1 2>err &&
+       test_i18ngrep ! "Pulling without specifying how to reconcile" err
+'
+
 test_expect_success 'pull.rebase not set and --ff-only given' '
        git reset --hard c0 &&
        git pull --ff-only . c1 2>err &&