Skip to content

Commit

Permalink
rebase-i: keep old parents when preserving merges
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
sbeyer authored and gitster committed Jul 16, 2008
1 parent 01941bd commit 1c5fa0a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c5fa0a

Please sign in to comment.