Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.RepositoryState


    Collections.sort(only);

    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 {
View Full Code Here


   */
  public Ref call() throws GitAPIException, ConcurrentRefUpdateException,
      InvalidTagNameException, NoHeadException {
    checkCallable();

    RepositoryState state = repo.getRepositoryState();
    processOptions(state);

    RevWalk revWalk = new RevWalk(repo);
    try {
      // if no id is set, we should attempt to use HEAD
View Full Code Here

   */
  public Ref call() throws GitAPIException, CheckoutConflictException {
    checkCallable();

    try {
      RepositoryState state = repo.getRepositoryState();
      final boolean merging = state.equals(RepositoryState.MERGING)
          || state.equals(RepositoryState.MERGING_RESOLVED);
      final boolean cherryPicking = state
          .equals(RepositoryState.CHERRY_PICKING)
          || state.equals(RepositoryState.CHERRY_PICKING_RESOLVED);
      final boolean reverting = state.equals(RepositoryState.REVERTING)
          || state.equals(RepositoryState.REVERTING_RESOLVED);

      final ObjectId commitId = resolveRefToCommitId();
      // When ref is explicitly specified, it has to resolve
      if (ref != null && commitId == null) {
        // @TODO throw an InvalidRefNameException. We can't do that
View Full Code Here

  public RevCommit call() throws NoHeadException, NoMessageException,
      UnmergedPathException, ConcurrentRefUpdateException,
      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) {
        Git git = new Git(repo);
View Full Code Here

      NoMessageException, UnmergedPathsException,
      ConcurrentRefUpdateException,
      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);
View Full Code Here

      NoMessageException, UnmergedPathsException,
      ConcurrentRefUpdateException,
      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);
View Full Code Here

   */
  public Ref call() throws GitAPIException, ConcurrentRefUpdateException,
      InvalidTagNameException, NoHeadException {
    checkCallable();

    RepositoryState state = repo.getRepositoryState();
    processOptions(state);

    try {
      // create the tag object
      TagBuilder newTag = new TagBuilder();
View Full Code Here

    Ref r;
    RevCommit commit;

    try {
      RepositoryState state = repo.getRepositoryState();
      final boolean merging = state.equals(RepositoryState.MERGING)
          || state.equals(RepositoryState.MERGING_RESOLVED);
      final boolean cherryPicking = state
          .equals(RepositoryState.CHERRY_PICKING)
          || state.equals(RepositoryState.CHERRY_PICKING_RESOLVED);

      // resolve the ref to a commit
      final ObjectId commitId;
      try {
        commitId = repo.resolve(ref + "^{commit}");
View Full Code Here

  }

  private static String getRepositoryName(Repository repository) {
    String repoName = Activator.getDefault().getRepositoryUtil()
        .getRepositoryName(repository);
    RepositoryState state = repository.getRepositoryState();
    if (state != RepositoryState.SAFE)
      return repoName + '|' + state.getDescription();
    else
      return repoName;
  }
View Full Code Here

  private boolean isInRebasingState(Repository repo) {
    if (repo == null)
      return false;

    RepositoryState state = repo.getRepositoryState();
    return state.isRebasing();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.RepositoryState

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.