Examples of lookupCommit()


Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

    RevWalk revWalk = null;
    try {
      revWalk = new RevWalk(repository);
      RevCommit branchTip = revWalk.lookupCommit(repository.resolve(toBranch));
      RevCommit srcTip = revWalk.lookupCommit(repository.resolve(src));
      if (revWalk.isMergedInto(srcTip, branchTip)) {
        // already merged
        return new MergeResult(MergeStatus.ALREADY_MERGED, null);
      }
      RecursiveMerger merger = (RecursiveMerger) MergeStrategy.RECURSIVE.newMerger(repository, true);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

  public static boolean isMergedInto(Repository repository, ObjectId commitId, ObjectId tipCommitId) {
    // traverse the revlog looking for a commit chain between the endpoints
    RevWalk rw = new RevWalk(repository);
    try {
      // must re-lookup RevCommits to workaround undocumented RevWalk bug
      RevCommit tip = rw.lookupCommit(tipCommitId);
      RevCommit commit = rw.lookupCommit(commitId);
      return rw.isMergedInto(commit, tip);
    } catch (Exception e) {
      LOGGER.error("Failed to determine isMergedInto", e);
    } finally {
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

    // traverse the revlog looking for a commit chain between the endpoints
    RevWalk rw = new RevWalk(repository);
    try {
      // must re-lookup RevCommits to workaround undocumented RevWalk bug
      RevCommit tip = rw.lookupCommit(tipCommitId);
      RevCommit commit = rw.lookupCommit(commitId);
      return rw.isMergedInto(commit, tip);
    } catch (Exception e) {
      LOGGER.error("Failed to determine isMergedInto", e);
    } finally {
      rw.dispose();
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

   * @return the commit id of the merge base or null if there is no common base
   */
  public static String getMergeBase(Repository repository, ObjectId commitIdA, ObjectId commitIdB) {
    RevWalk rw = new RevWalk(repository);
    try {
      RevCommit a = rw.lookupCommit(commitIdA);
      RevCommit b = rw.lookupCommit(commitIdB);

      rw.setRevFilter(RevFilter.MERGE_BASE);
      rw.markStart(a);
      rw.markStart(b);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

   */
  public static String getMergeBase(Repository repository, ObjectId commitIdA, ObjectId commitIdB) {
    RevWalk rw = new RevWalk(repository);
    try {
      RevCommit a = rw.lookupCommit(commitIdA);
      RevCommit b = rw.lookupCommit(commitIdB);

      rw.setRevFilter(RevFilter.MERGE_BASE);
      rw.markStart(a);
      rw.markStart(b);
      RevCommit mergeBase = rw.next();
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

   */
  public static MergeStatus canMerge(Repository repository, String src, String toBranch) {
    RevWalk revWalk = null;
    try {
      revWalk = new RevWalk(repository);
      RevCommit branchTip = revWalk.lookupCommit(repository.resolve(toBranch));
      RevCommit srcTip = revWalk.lookupCommit(repository.resolve(src));
      if (revWalk.isMergedInto(srcTip, branchTip)) {
        // already merged
        return MergeStatus.ALREADY_MERGED;
      } else if (revWalk.isMergedInto(branchTip, srcTip)) {
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

  public static MergeStatus canMerge(Repository repository, String src, String toBranch) {
    RevWalk revWalk = null;
    try {
      revWalk = new RevWalk(repository);
      RevCommit branchTip = revWalk.lookupCommit(repository.resolve(toBranch));
      RevCommit srcTip = revWalk.lookupCommit(repository.resolve(src));
      if (revWalk.isMergedInto(srcTip, branchTip)) {
        // already merged
        return MergeStatus.ALREADY_MERGED;
      } else if (revWalk.isMergedInto(branchTip, srcTip)) {
        // fast-forward
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

    }

    RevWalk revWalk = null;
    try {
      revWalk = new RevWalk(repository);
      RevCommit branchTip = revWalk.lookupCommit(repository.resolve(toBranch));
      RevCommit srcTip = revWalk.lookupCommit(repository.resolve(src));
      if (revWalk.isMergedInto(srcTip, branchTip)) {
        // already merged
        return new MergeResult(MergeStatus.ALREADY_MERGED, null);
      }
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

    RevWalk revWalk = null;
    try {
      revWalk = new RevWalk(repository);
      RevCommit branchTip = revWalk.lookupCommit(repository.resolve(toBranch));
      RevCommit srcTip = revWalk.lookupCommit(repository.resolve(src));
      if (revWalk.isMergedInto(srcTip, branchTip)) {
        // already merged
        return new MergeResult(MergeStatus.ALREADY_MERGED, null);
      }
      RecursiveMerger merger = (RecursiveMerger) MergeStrategy.RECURSIVE.newMerger(repository, true);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevWalk.lookupCommit()

      throws IOException {
    RevWalk revWalk = new RevWalk(db);
    ObjectId oldHeadObjectId = oldHead.getPeeledObjectId();
    if (oldHeadObjectId == null)
      oldHeadObjectId = oldHead.getObjectId();
    RevCommit oldHeadCommit = revWalk.lookupCommit(oldHeadObjectId);
    RevCommit srcCommit = revWalk.lookupCommit(src);
    return revWalk.isMergedInto(oldHeadCommit, srcCommit);
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.