Prior this changeset, rebasing a merge whose first parent was not in the rebase lead to wrong and highly conflicting merge. See the in-line comment for details. Test have been updated with the data provided by the reported.