Package org.eclipse.jgit.api.errors

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


    checkCallable();
    if (!startSpecified) {
      try {
        ObjectId headId = repo.resolve(Constants.HEAD);
        if (headId == null)
          throw new NoHeadException(
              JGitText.get().noHEADExistsAndNoExplicitStartingRevisionWasSpecified);
        add(headId);
      } catch (IOException e) {
        // all exceptions thrown by add() shouldn't occur and represent
        // severe low-level exception which are therefore wrapped
View Full Code Here


      // if no id is set, we should attempt to use HEAD
      if (id == null) {
        ObjectId objectId = repo.resolve(Constants.HEAD + "^{commit}");
        if (objectId == null)
          throw new NoHeadException(
              JGitText.get().tagOnRepoWithoutHEADCurrentlyNotSupported);

        newTag.setObjectId(objectId, Constants.OBJ_COMMIT);
      } else {
        newTag.setObjectId(id);
View Full Code Here

        }
      }

      Ref head = repo.getRef(Constants.HEAD);
      if (head == null)
        throw new NoHeadException(
            JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);

      // determine the current HEAD and the commit it is referring to
      ObjectId headId = repo.resolve(Constants.HEAD + "^{commit}");
      if (headId != null)
View Full Code Here

  private RevCommit checkoutCurrentHead() throws IOException,
      NoHeadException, JGitInternalException {
    ObjectId headTree = repo.resolve(Constants.HEAD + "^{tree}");
    if (headTree == null)
      throw new NoHeadException(
          JGitText.get().cannotRebaseWithoutCurrentHead);
    DirCache dc = repo.lockDirCache();
    try {
      DirCacheCheckout dco = new DirCacheCheckout(repo, dc, headTree);
      dco.setFailOnConflict(false);
View Full Code Here

    treeWalk.reset();
    treeWalk.setRecursive(true);
    treeWalk.addTree(new DirCacheIterator(dc));
    ObjectId id = repo.resolve(Constants.HEAD + "^{tree}");
    if (id == null)
      throw new NoHeadException(
          JGitText.get().cannotRebaseWithoutCurrentHead);

    treeWalk.addTree(id);

    treeWalk.setFilter(TreeFilter.ANY_DIFF);
View Full Code Here

      walk.setTreeFilter(PathFilterGroup.create(pathFilters));
    if (!startSpecified) {
      try {
        ObjectId headId = repo.resolve(Constants.HEAD);
        if (headId == null)
          throw new NoHeadException(
              JGitText.get().noHEADExistsAndNoExplicitStartingRevisionWasSpecified);
        add(headId);
      } catch (IOException e) {
        // all exceptions thrown by add() shouldn't occur and represent
        // severe low-level exception which are therefore wrapped
View Full Code Here

  private Ref getHead() throws GitAPIException {
    try {
      Ref head = repo.getRef(Constants.HEAD);
      if (head == null || head.getObjectId() == null)
        throw new NoHeadException(JGitText.get().headRequiredToStash);
      return head;
    } catch (IOException e) {
      throw new JGitInternalException(JGitText.get().stashFailed, e);
    }
  }
View Full Code Here

    String branchName;
    try {
      String fullBranch = repo.getFullBranch();
      if (fullBranch == null)
        throw new NoHeadException(
            JGitText.get().pullOnRepoWithoutHEADCurrentlyNotSupported);
      if (!fullBranch.startsWith(Constants.R_HEADS)) {
        // we can not pull if HEAD is detached and branch is not
        // specified explicitly
        throw new DetachedHeadException();
View Full Code Here

      walk.setRevFilter(MaxCountRevFilter.create(maxCount));
    if (!startSpecified) {
      try {
        ObjectId headId = repo.resolve(Constants.HEAD);
        if (headId == null)
          throw new NoHeadException(
              JGitText.get().noHEADExistsAndNoExplicitStartingRevisionWasSpecified);
        add(headId);
      } catch (IOException e) {
        // all exceptions thrown by add() shouldn't occur and represent
        // severe low-level exception which are therefore wrapped
View Full Code Here

        }
      }

      Ref head = repo.getRef(Constants.HEAD);
      if (head == null)
        throw new NoHeadException(
            JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);

      // determine the current HEAD and the commit it is referring to
      ObjectId headId = repo.resolve(Constants.HEAD + "^{commit}"); //$NON-NLS-1$
      if (headId == null && amend)
View Full Code Here

TOP

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

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.