]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/rebase.c
rebase: refactor can_fast_forward into goto tower
authorDenton Liu <liu.denton@gmail.com>
Tue, 27 Aug 2019 05:37:56 +0000 (01:37 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Aug 2019 22:33:40 +0000 (15:33 -0700)
commit2b318aa6c3566ad65d9547f42828f277955e6519
tree9bcebc2372ae4d795c96dd57ab9ee299d9a08fe9
parentc9efc216830fa2fb71e7d917294e4530a33a4da1
rebase: refactor can_fast_forward into goto tower

Before, can_fast_forward was written with an if-else statement. However,
in the future, we may be adding more termination cases which would lead
to deeply nested if statements.

Refactor to use a goto tower so that future cases can be easily
inserted.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c