From: Stephan Beyer Date: Wed, 16 Jul 2008 01:51:49 +0000 (+0200) Subject: rebase-i: keep old parents when preserving merges X-Git-Tag: v1.5.6.4~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1c5fa0a179a76f13a6970a281ad876cff44fd8ee rebase-i: keep old parents when preserving merges When "rebase -i -p" tries to preserve merges of unrelated branches, it lost some parents: - When you have more than two parents, the commit in the new history ends up with fewer than expected number of parents and this breakage goes unnoticed; - When you are rebasing a merge with two parents and one is lost, the command tries to cherry-pick the original merge commit, and the command fails. Signed-off-by: Stephan Beyer Signed-off-by: Junio C Hamano --- diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index a64d9d57ab..e3f65bd880 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -162,6 +162,8 @@ pick_one_preserving_merges () { new_parents="$new_parents $new_p" ;; esac + else + new_parents="$new_parents $p" fi done case $fast_forward in