Package org.eclipse.jgit.api.errors

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


          : 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

        throw new RefAlreadyExistsException(MessageFormat.format(
            JGitText.get().refAlreadyExists, 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

      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 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

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.