Merge "AbstractSubmit: Format with google-java-format"
This commit is contained in:
@@ -588,6 +588,50 @@ 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
|
||||
|
||||
@@ -105,7 +105,7 @@ public class RebaseSorter {
|
||||
mirw.markStart(commit);
|
||||
// check if the commit is merged in other branches
|
||||
for (RevCommit accepted : alreadyAccepted) {
|
||||
if (mirw.isMergedInto(mirw.parseCommit(accepted), mirw.parseCommit(commit))) {
|
||||
if (mirw.isMergedInto(mirw.parseCommit(commit), mirw.parseCommit(accepted))) {
|
||||
log.debug(
|
||||
"Dependency {} merged into branch head {}.", commit.getName(), accepted.getName());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user