Package org.eclipse.jgit.api.errors

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


    try {
      RevWalk revWalk = new RevWalk(reader);

      ObjectId headCommit = repo.resolve(Constants.HEAD);
      if (headCommit == null)
        throw new NoHeadException(JGitText.get().stashApplyWithoutHead);

      final ObjectId stashId = getStashId();
      RevCommit stashCommit = revWalk.parseCommit(stashId);
      if (stashCommit.getParentCount() != 2)
        throw new JGitInternalException(MessageFormat.format(
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

    try {

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

      newHead = revWalk.parseCommit(headRef.getObjectId());

      // loop through all refs to be cherry-picked
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

    try {

      // get the head commit
      Ref headRef = repo.getRef(Constants.HEAD);
      if (headRef == null)
        throw new NoHeadException(
            JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported);
      RevCommit headCommit = revWalk.parseCommit(headRef.getObjectId());

      newHead = headCommit;
View Full Code Here

        try {
            if ( cached ) {
                if ( oldTree == null ) {
                    ObjectId head = repo.resolve( HEAD + "^{tree}" ); //$NON-NLS-1$
                    if ( head == null ) {
                        throw new NoHeadException( JGitText.get().cannotReadTree );
                    }
                    CanonicalTreeParser p = new CanonicalTreeParser();
                    ObjectReader reader = repo.newObjectReader();
                    try {
                        p.reset( reader, head );
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.