Class MergeTip

java.lang.Object
com.google.gerrit.server.git.MergeTip

public class MergeTip extends Object
Class describing a merge tip during merge operation.

The current tip of a MergeTip may be null if the merge operation is against an unborn branch, and has not yet been attempted. This is distinct from a null MergeTip instance, which may be used to indicate that a merge failed or another error state.

  • Constructor Details

    • MergeTip

      public MergeTip(CodeReviewCommit initialTip, Collection<CodeReviewCommit> toMerge)
      Parameters:
      initialTip - tip before the merge operation; may be null, indicating an unborn branch.
      toMerge - list of commits to be merged in merge operation; may not be null or empty.
  • Method Details

    • getInitialTip

      public CodeReviewCommit getInitialTip()
      Returns the initial tip of the branch before the merge operation started; may be null, indicating a previously unborn branch.
    • moveTipTo

      public void moveTipTo(CodeReviewCommit newTip, org.eclipse.jgit.lib.ObjectId mergedFrom)
      Moves this MergeTip to newTip and appends mergeResult.
      Parameters:
      newTip - The new tip; may not be null.
      mergedFrom - The result of the merge of newTip.
    • getMergeResults

      public Map<org.eclipse.jgit.lib.ObjectId,org.eclipse.jgit.lib.ObjectId> getMergeResults()
      The merge results of all the merges of this merge operation.
      Returns:
      The merge results of the merge operation as a map of SHA-1 to be merged to SHA-1 of the merge result.
    • getCurrentTip

      public CodeReviewCommit getCurrentTip()
      Returns The current tip of the current merge operation; may be null, indicating an unborn branch.