Fix the wrong order of RevWalk.isMergedInto in RebaseSorter

RevWalk.isMergedInto takes the base as first argument and the tip as
the second argument to check if the base is merged into the tip. The
test didn't detect it because in the test the base is the same as the
tip.

Also add a regression test for this bug.

Change-Id: I43742aa4bd75ea64e729c1d3ecf40369002c7e55
This commit is contained in:
Zhen Chen
2017-03-30 11:11:39 -07:00
parent 62e6711dcd
commit 15e9a266b3
2 changed files with 44 additions and 2 deletions

View File

@@ -94,8 +94,8 @@ public class RebaseSorter {
mirw.reset();
mirw.markStart(commit);
for (RevCommit accepted : alreadyAccepted) {
if (mirw.isMergedInto(mirw.parseCommit(accepted),
mirw.parseCommit(commit))) {
if (mirw.isMergedInto(mirw.parseCommit(commit),
mirw.parseCommit(accepted))) {
return true;
}
}