Package org.eclipse.jgit.api.errors

Examples of org.eclipse.jgit.api.errors.RefNotFoundException


        }
        branch = getStartPointObjectId();
      } else {
        branch = repo.resolve(name);
        if (branch == null)
          throw new RefNotFoundException(MessageFormat.format(
              JGitText.get().refNotResolved, name));
      }

      RevWalk revWalk = new RevWalk(repo);
      AnyObjectId headId = headRef.getObjectId();
View Full Code Here


    String startPointOrHead = (startPoint != null) ? startPoint
        : Constants.HEAD;
    ObjectId result = repo.resolve(startPointOrHead);
    if (result == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, startPointOrHead));
    return result;
  }
View Full Code Here

    Ref head = getHead();

    String headName = getHeadName(head);
    ObjectId headId = head.getObjectId();
    if (headId == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, Constants.HEAD));
    RevCommit headCommit = walk.lookupCommit(headId);
    RevCommit upstream = walk.lookupCommit(upstreamCommit.getId());

    if (!isInteractive() && walk.isMergedInto(upstream, headCommit))
View Full Code Here

  }

  private Ref getHead() throws IOException, RefNotFoundException {
    Ref head = repo.getRef(Constants.HEAD);
    if (head == null || head.getObjectId() == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, Constants.HEAD));
    return head;
  }
View Full Code Here

      GitAPIException {
    Ref head = getHead();

    ObjectId headId = head.getObjectId();
    if (headId == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, Constants.HEAD));
    RevCommit headCommit = walk.lookupCommit(headId);
    if (walk.isMergedInto(newCommit, headCommit))
      return newCommit;
View Full Code Here

  public RebaseCommand setUpstream(String upstream)
      throws RefNotFoundException {
    try {
      ObjectId upstreamId = repo.resolve(upstream);
      if (upstreamId == null)
        throw new RefNotFoundException(MessageFormat.format(JGitText
            .get().refNotResolved, upstream));
      upstreamCommit = walk.parseCommit(repo.resolve(upstream));
      upstreamCommitName = upstream;
      return this;
    } catch (IOException ioe) {
View Full Code Here

      Ref headRef = repo.getRef(Constants.HEAD);
      String shortHeadRef = getShortBranchName(headRef);
      String refLogMessage = "checkout: moving from " + shortHeadRef;
      ObjectId branch = repo.resolve(name);
      if (branch == null)
        throw new RefNotFoundException(MessageFormat.format(JGitText
            .get().refNotResolved, name));

      RevWalk revWalk = new RevWalk(repo);
      AnyObjectId headId = headRef.getObjectId();
      RevCommit headCommit = headId == null ? null : revWalk
View Full Code Here

          : startPoint);
    } catch (AmbiguousObjectException e) {
      throw e;
    }
    if (result == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved,
          startPoint != null ? startPoint : Constants.HEAD));
    return result;
  }
View Full Code Here

    // we need to store everything into files so that we can implement
    // --skip, --continue, and --abort

    Ref head = repo.getRef(Constants.HEAD);
    if (head == null || head.getObjectId() == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, Constants.HEAD));

    String headName;
    if (head.isSymbolic())
      headName = head.getTarget().getName();
    else
      headName = "detached HEAD";
    ObjectId headId = head.getObjectId();
    if (headId == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, Constants.HEAD));
    RevCommit headCommit = walk.lookupCommit(headId);
    RevCommit upstream = walk.lookupCommit(upstreamCommit.getId());

    if (walk.isMergedInto(upstream, headCommit))
View Full Code Here

   */
  public RevCommit tryFastForward(RevCommit newCommit) throws IOException,
      GitAPIException {
    Ref head = repo.getRef(Constants.HEAD);
    if (head == null || head.getObjectId() == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, Constants.HEAD));

    ObjectId headId = head.getObjectId();
    if (headId == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, Constants.HEAD));
    RevCommit headCommit = walk.lookupCommit(headId);
    if (walk.isMergedInto(newCommit, headCommit))
      return newCommit;

View Full Code Here

TOP

Related Classes of org.eclipse.jgit.api.errors.RefNotFoundException

Copyright © 2018 www.massapicom. 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.