Package org.eclipse.jgit.api.errors

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


          JGitText.get().exceptionCaughtDuringExecutionOfPullCommand,
          e);
    }

    if (!repo.getRepositoryState().equals(RepositoryState.SAFE))
      throw new WrongRepositoryStateException(MessageFormat.format(
          JGitText.get().cannotPullOnARepoWithState, repo
              .getRepositoryState().name()));

    // get the configured remote for the currently checked out branch
    // stored in configuration key branch.<branch name>.remote
View Full Code Here


      WrongRepositoryStateException, NoHeadException,
      StashApplyFailureException {
    checkCallable();

    if (repo.getRepositoryState() != RepositoryState.SAFE)
      throw new WrongRepositoryStateException(MessageFormat.format(
          JGitText.get().stashApplyOnUnsafeRepository,
          repo.getRepositoryState()));

    ObjectReader reader = repo.newObjectReader();
    try {
View Full Code Here

    RevWalk rw = new RevWalk(repo);

    try {
      RepositoryState state = repo.getRepositoryState();
      if (!state.canCommit())
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().cannotCommitOnARepoWithState,
            state.name()));
      processOptions(state, rw);

      if (all && !repo.isBare() && repo.getWorkTree() != null) {
        Git git = new Git(repo);
        try {
          git.add()
              .addFilepattern(".") //$NON-NLS-1$
              .setUpdate(true).call();
        } catch (NoFilepatternException e) {
          // should really not happen
          throw new JGitInternalException(e.getMessage(), e);
        }
      }

      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)
        throw new WrongRepositoryStateException(
            JGitText.get().commitAmendOnInitialNotPossible);

      if (headId != null)
        if (amend) {
          RevCommit previousCommit = rw.parseCommit(headId);
View Full Code Here

TOP

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

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.