Merge branch 'stable-2.13' into stable-2.14
* stable-2.13: Fix the wrong order of RevWalk.isMergedInto in RebaseSorter Change-Id: Ic153446a86f76c656642958fbe10ab6b11980572
This commit is contained in:
@@ -588,6 +588,48 @@ public abstract class AbstractSubmit extends AbstractDaemonTest {
|
||||
assertThat(log).contains(mergeReview.getCommit());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void submitMergeOfNonChangeBranchNonTip() throws Exception {
|
||||
// Merge a branch with commits that have not been submitted as
|
||||
// changes.
|
||||
//
|
||||
// MC -- merge commit (pushed for review and submitted)
|
||||
// |\ S2 -- new stable tip (pushed directly to refs/heads/stable)
|
||||
// M \ /
|
||||
// | S1 -- stable (pushed directly to refs/heads/stable)
|
||||
// | /
|
||||
// I -- master
|
||||
//
|
||||
RevCommit initial = getRemoteHead(project, "master");
|
||||
// push directly to stable to S1
|
||||
PushOneCommit.Result s1 = pushFactory.create(
|
||||
db, admin.getIdent(), testRepo, "new commit into stable", "stable1.txt", "")
|
||||
.to("refs/heads/stable");
|
||||
// move the stable tip ahead to S2
|
||||
pushFactory.create(
|
||||
db, admin.getIdent(), testRepo, "Tip of branch stable", "stable2.txt", "")
|
||||
.to("refs/heads/stable");
|
||||
|
||||
testRepo.reset(initial);
|
||||
|
||||
// move the master ahead
|
||||
PushOneCommit.Result m = pushFactory.create(
|
||||
db, admin.getIdent(), testRepo, "Move master ahead", "master.txt", "")
|
||||
.to("refs/heads/master");
|
||||
|
||||
// create merge change
|
||||
PushOneCommit mc =
|
||||
pushFactory.create(db, admin.getIdent(), testRepo, "The merge commit", "merge.txt", "");
|
||||
mc.setParents(ImmutableList.of(m.getCommit(), s1.getCommit()));
|
||||
PushOneCommit.Result mergeReview = mc.to("refs/for/master");
|
||||
approve(mergeReview.getChangeId());
|
||||
submit(mergeReview.getChangeId());
|
||||
|
||||
List<RevCommit> log = getRemoteLog();
|
||||
assertThat(log).contains(s1.getCommit());
|
||||
assertThat(log).contains(mergeReview.getCommit());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void submitChangeWithCommitThatWasAlreadyMerged() throws Exception {
|
||||
// create and submit a change
|
||||
|
||||
Reference in New Issue
Block a user