From 3d5fc24daefbdf56bc36a491aed0b7990fa0c62f Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Wed, 21 Jul 2021 01:42:19 +0000 Subject: 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 [en: updated tests; note 3 fixes and 1 new failure] Signed-off-by: Elijah Newren Signed-off-by: Junio C Hamano --- advice.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'advice.c') diff --git a/advice.c b/advice.c index 0b9c89c48a..337e8f342b 100644 --- a/advice.c +++ b/advice.c @@ -286,6 +286,11 @@ void NORETURN die_conclude_merge(void) die(_("Exiting because of unfinished merge.")); } +void NORETURN die_ff_impossible(void) +{ + die(_("Not possible to fast-forward, aborting.")); +} + void advise_on_updating_sparse_paths(struct string_list *pathspec_list) { struct string_list_item *item; -- cgit v1.2.3