@@ -1013,7 +1013,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
can_ff = get_can_ff(&orig_head, &merge_heads.oid[0]);
- if (default_mode && opt_verbosity >= 0 && !opt_ff) {
+ if (default_mode && !can_ff && 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"
@@ -28,11 +28,17 @@ test_expect_success 'setup' '
'
test_expect_success 'pull.rebase not set' '
- git reset --hard c0 &&
+ git reset --hard c2 &&
git pull . c1 2>err &&
test_i18ngrep "Pulling without specifying how to reconcile" err
'
+test_expect_success 'pull.rebase not set (fast-forward)' '
+ git reset --hard c0 &&
+ git pull . c1 2>err &&
+ 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 &&
There's no need to display the annoying warning on every pull... only the ones that are not fast-forward. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- builtin/pull.c | 2 +- t/t7601-merge-pull-config.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-)