pull: abort if --ff-only is given and fast-forwarding is impossible

The warning about pulling without specifying how to reconcile divergent
branches says that after setting pull.rebase to true, --ff-only can
still be passed on the command line to require a fast-forward. Make that
actually work.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
[en: updated tests; note 3 fixes and 1 new failure]
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alex Henrie
2021-07-21 01:42:19 +00:00
committed by Junio C Hamano
parent 1d25e5bdf5
commit 3d5fc24dae
5 changed files with 20 additions and 9 deletions

View File

@ -1620,7 +1620,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
}
if (fast_forward == FF_ONLY)
die(_("Not possible to fast-forward, aborting."));
die_ff_impossible();
if (autostash)
create_autostash(the_repository,