Package org.eclipse.jgit.api.errors

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


    // first of all, we determine the commits to be applied
    List<RevCommit> cherryPickList = new ArrayList<RevCommit>();

    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);
    monitor.beginTask(JGitText.get().obtainingCommitsForCherryPick,
        ProgressMonitor.UNKNOWN);
View Full Code Here


   */
  public RevCommit tryFastForward(RevCommit newCommit)
      throws RefNotFoundException, IOException {
    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

  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));
      return this;
    } catch (IOException ioe) {
      throw new JGitInternalException(ioe.getMessage(), ioe);
View Full Code Here

      Ref headRef = repo.getRef(Constants.HEAD);
      String refLogMessage = "checkout: moving from "
          + headRef.getTarget().getName();
      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

        commitToMerge = r.getObjectId();
    } else {
      try {
        commitToMerge = repo.resolve(remoteBranchName);
        if (commitToMerge == null)
          throw new RefNotFoundException(MessageFormat.format(
              JGitText.get().refNotResolved, remoteBranchName));
      } catch (IOException e) {
        throw new JGitInternalException(
            JGitText.get().exceptionCaughtDuringExecutionOfPullCommand,
            e);
View Full Code Here

   */
  public DescribeCommand setTarget(String rev) throws IOException,
      RefNotFoundException {
    ObjectId id = repo.resolve(rev);
    if (id == null)
      throw new RefNotFoundException(MessageFormat.format(JGitText.get().refNotResolved, rev));
    return setTarget(id);
  }
View Full Code Here

    RevWalk walk = new RevWalk(repo);
    try {
      ObjectId resolved = repo.resolve(containsCommitish);
      if (resolved == null)
        throw new RefNotFoundException(MessageFormat.format(
            JGitText.get().refNotResolved, containsCommitish));

      RevCommit containsCommit = walk.parseCommit(resolved);
      return RevWalkUtils.findBranchesReachableFrom(containsCommit, walk,
          refs);
View Full Code Here

    if (startCommit != null)
      return startCommit.getId();
    String startPointOrHead = getStartPointOrHead();
    ObjectId result = repo.resolve(startPointOrHead);
    if (result == null)
      throw new RefNotFoundException(MessageFormat.format(
          JGitText.get().refNotResolved, startPointOrHead));
    return result;
  }
View Full Code Here

        throw new RefAlreadyExistsException(MessageFormat.format(
            JGitText.get().refAlreadyExists1, newName));
      if (oldName != null) {
        Ref ref = repo.getRef(oldName);
        if (ref == null)
          throw new RefNotFoundException(MessageFormat.format(
              JGitText.get().refNotResolved, oldName));
        if (ref.getName().startsWith(Constants.R_TAGS))
          throw new RefNotFoundException(MessageFormat.format(
              JGitText.get().renameBranchFailedBecauseTag,
              oldName));
        fullOldName = ref.getName();
      } else {
        fullOldName = repo.getFullBranch();
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.