MergeTip: Clarify what null means
CherryPick was using a null MergeTip instance where the other strategies were creating a non-null instance whose current tip was set to null. Fix the documentation (and CherryPick), explicitly mentioning a null tip as referring to a branch that is unborn at the start of the merge operation. Change-Id: Ie3b5e9e2ae3a9fb62827a10f0577d708fb14a8cc
This commit is contained in:
@@ -66,13 +66,12 @@ public class CherryPick extends SubmitStrategy {
|
||||
@Override
|
||||
protected MergeTip _run(CodeReviewCommit branchTip,
|
||||
Collection<CodeReviewCommit> toMerge) throws MergeException {
|
||||
MergeTip mergeTip = branchTip != null
|
||||
? new MergeTip(branchTip, toMerge) : null;
|
||||
MergeTip mergeTip = new MergeTip(branchTip, toMerge);
|
||||
List<CodeReviewCommit> sorted = CodeReviewCommit.ORDER.sortedCopy(toMerge);
|
||||
while (!sorted.isEmpty()) {
|
||||
CodeReviewCommit n = sorted.remove(0);
|
||||
try {
|
||||
if (mergeTip == null) {
|
||||
if (mergeTip.getCurrentTip() == null) {
|
||||
mergeTip = cherryPickUnbornRoot(n);
|
||||
} else if (n.getParentCount() == 0) {
|
||||
cherryPickRootOntoBranch(n);
|
||||
|
Reference in New Issue
Block a user