rebase: fast-forward --fork-point in more cases
authorDenton Liu <liu.denton@gmail.com>
Tue, 27 Aug 2019 05:38:01 +0000 (01:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Aug 2019 22:33:40 +0000 (15:33 -0700)
commit4effc5bc96ab8cd057e034c11d6f4b93b49cb0a3
treef932e06b1601897a6b38ac3a522855d3e1ef22fd
parentc0efb4c1ddccf91dedd5775f2f449574e90b051a
rebase: fast-forward --fork-point in more cases

Before, when we rebased with a --fork-point invocation where the
fork-point wasn't empty, we would be setting options.restrict_revision.
The fast-forward logic would automatically declare that the rebase was
not fast-forwardable if it was set. However, this was painting with a
very broad brush.

Refine the logic so that we can fast-forward in the case where the
restricted revision is equal to the merge base, since we stop rebasing
at the merge base anyway.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c
t/t3432-rebase-fast-forward.sh