@matheusbsbs / matheus-bagliano / commits / 1c5fa0a179
Fork 0

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 <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stephan Beyer committed Jul 16, 2008 at 03:51 UTC 1c5fa0a179a76f13a6970a281ad876cff44fd8ee
1 file changed +2
git-rebase--interactive.sh
+2
@@ -162,6 +162,8 @@ pick_one_preserving_merges () {
162 new_parents="$new_parents $new_p"
163 ;;
164 esac
165 + else
166 + new_parents="$new_parents $p"
167 fi
168 done
169 case $fast_forward in