]> git.ipfire.org Git - thirdparty/git.git/commit - commit.c
rebase: --fork-point regression fix
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Dec 2019 18:51:47 +0000 (10:51 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Feb 2020 17:59:39 +0000 (09:59 -0800)
commitf08132f889c00a8108f61541e047649ad0e660e4
treef5e3a0f2b336c05ffbedc12238968ebdf2ca70e4
parentda72936f544fec5a335e66432610e4cef4430991
rebase: --fork-point regression fix

"git rebase --fork-point master" used to work OK, as it internally
called "git merge-base --fork-point" that knew how to handle short
refname and dwim it to the full refname before calling the
underlying get_fork_point() function.

This is no longer true after the command was rewritten in C, as its
internall call made directly to get_fork_point() does not dwim a
short ref.

Move the "dwim the refname argument to the full refname" logic that
is used in "git merge-base" to the underlying get_fork_point()
function, so that the other caller of the function in the
implementation of "git rebase" behaves the same way to fix this
regression.

Signed-off-by: Alex Torok <alext9@gmail.com>
[jc: revamped the fix and used Alex's tests]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge-base.c
commit.c
t/t3431-rebase-fork-point.sh