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


      JGitInternalException, WrongRepositoryStateException {
    checkCallable();

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

    try {
      if (all && !repo.isBare() && repo.getWorkTree() != null) {
View Full Code Here

      // these operations are only possible while in a rebasing state
      switch (repo.getRepositoryState()) {
      case REBASING_INTERACTIVE:
        break;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));
      }
    } else
      switch (repo.getRepositoryState()) {
      case SAFE:
        if (this.upstreamCommit == null)
          throw new JGitInternalException(MessageFormat
              .format(JGitText.get().missingRequiredParameter,
                  "upstream"));
        return;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));

      }
  }
View Full Code Here

      JGitInternalException, WrongRepositoryStateException {
    checkCallable();

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

    try {
      if (all && !repo.isBare() && repo.getWorkTree() != null) {
View Full Code Here

          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

      // these operations are only possible while in a rebasing state
      switch (repo.getRepositoryState()) {
      case REBASING_INTERACTIVE:
        break;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));
      }
    } else
      switch (repo.getRepositoryState()) {
      case SAFE:
        if (this.upstreamCommit == null)
          throw new JGitInternalException(MessageFormat
              .format(JGitText.get().missingRequiredParameter,
                  "upstream"));
        return;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));

      }
  }
View Full Code Here

      WrongRepositoryStateException {
    checkCallable();

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

    try {
      if (all && !repo.isBare() && repo.getWorkTree() != null) {
        Git git = new Git(repo);
        try {
          git.add()
              .addFilepattern(".")
              .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}");
      if (headId == null && amend)
        throw new WrongRepositoryStateException(
            JGitText.get().commitAmendOnInitialNotPossible);

      if (headId != null)
        if (amend) {
          RevCommit previousCommit = new RevWalk(repo)
View Full Code Here

          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

      case REBASING:
      case REBASING_REBASING:
      case REBASING_MERGE:
        break;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));
      }
    } else
      switch (repo.getRepositoryState()) {
      case SAFE:
        if (this.upstreamCommit == null)
          throw new JGitInternalException(MessageFormat
              .format(JGitText.get().missingRequiredParameter,
                  "upstream"));
        return;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));

      }
  }
View Full Code Here

      // these operations are only possible while in a rebasing state
      switch (repo.getRepositoryState()) {
      case REBASING_INTERACTIVE:
        break;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));
      }
    } else
      switch (repo.getRepositoryState()) {
      case SAFE:
        if (this.upstreamCommit == null)
          throw new JGitInternalException(MessageFormat
              .format(JGitText.get().missingRequiredParameter,
                  "upstream"));
        return;
      default:
        throw new WrongRepositoryStateException(MessageFormat.format(
            JGitText.get().wrongRepositoryState, repo
                .getRepositoryState().name()));

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