Skip to content

Commit 54200ce

Browse files
alexhenriegitster
authored andcommitted
pull: don't warn if pull.ff has been set
A user who understands enough to set pull.ff does not need additional instructions. Signed-off-by: Alex Henrie <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b3d7a52 commit 54200ce

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

builtin/pull.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,7 @@ static enum rebase_type config_get_rebase(void)
344344
if (!git_config_get_value("pull.rebase", &value))
345345
return parse_config_rebase("pull.rebase", value, 1);
346346

347-
if (opt_verbosity >= 0 &&
348-
(!opt_ff || strcmp(opt_ff, "--ff-only"))) {
347+
if (opt_verbosity >= 0 && !opt_ff) {
349348
warning(_("Pulling without specifying how to reconcile divergent branches is\n"
350349
"discouraged. You can squelch this message by running one of the following\n"
351350
"commands sometime before your next pull:\n"

t/t7601-merge-pull-config.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@ test_expect_success 'pull.rebase not set' '
3333
test_i18ngrep "Pulling without specifying how to reconcile" err
3434
'
3535

36+
test_expect_success 'pull.rebase not set and pull.ff=true' '
37+
git reset --hard c0 &&
38+
test_config pull.ff true &&
39+
git pull . c1 2>err &&
40+
test_i18ngrep ! "Pulling without specifying how to reconcile" err
41+
'
42+
3643
test_expect_success 'pull.rebase not set and pull.ff=false' '
3744
git reset --hard c0 &&
3845
test_config pull.ff false &&
3946
git pull . c1 2>err &&
40-
test_i18ngrep "Pulling without specifying how to reconcile" err
47+
test_i18ngrep ! "Pulling without specifying how to reconcile" err
4148
'
4249

4350
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' '
5966
test_i18ngrep ! "Pulling without specifying how to reconcile" err
6067
'
6168

69+
test_expect_success 'pull.rebase not set and --ff given' '
70+
git reset --hard c0 &&
71+
git pull --ff . c1 2>err &&
72+
test_i18ngrep ! "Pulling without specifying how to reconcile" err
73+
'
74+
75+
test_expect_success 'pull.rebase not set and --no-ff given' '
76+
git reset --hard c0 &&
77+
git pull --no-ff . c1 2>err &&
78+
test_i18ngrep ! "Pulling without specifying how to reconcile" err
79+
'
80+
6281
test_expect_success 'pull.rebase not set and --ff-only given' '
6382
git reset --hard c0 &&
6483
git pull --ff-only . c1 2>err &&

0 commit comments

Comments
 (0)