Fix incorrect mergeTip detection in ChangeJson.toRevisionInfo.

Bug: Issue 5003
Change-Id: Ie5cf829e69e54b8b27344552cf4fc07f7a0db230
This commit is contained in:
Andrii Shyshkalov
2016-12-01 10:27:42 +01:00
parent b050a48e05
commit 31e4687891
2 changed files with 2 additions and 1 deletions

View File

@@ -1823,6 +1823,7 @@ public class ChangeIT extends AbstractDaemonTest {
@Override
public String onSubmit(String newCommitMessage, RevCommit original,
RevCommit mergeTip, Branch.NameKey destination) {
assertThat(original.getName()).isNotEqualTo(mergeTip.getName());
return newCommitMessage + "Custom: " + destination.get();
}
});

View File

@@ -1112,7 +1112,7 @@ public class ChangeJson {
out.commit = toCommit(ctl, rw, commit, has(WEB_LINKS), fillCommit);
}
if (addFooters) {
Ref ref = repo.exactRef(in.getRefName());
Ref ref = repo.exactRef(ctl.getChange().getDest().get());
RevCommit mergeTip = null;
if (ref != null){
mergeTip = rw.parseCommit(ref.getObjectId());