Examples of CheckoutConflictException


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

          repo.lockDirCache(), commit.getTree());
      dco.setFailOnConflict(true);
      try {
        dco.checkout();
      } catch (org.eclipse.jgit.errors.CheckoutConflictException cce) {
        throw new CheckoutConflictException(dco.getConflicts(), cce);
      }
      // update the HEAD
      RefUpdate refUpdate = repo.updateRef(Constants.HEAD, true);
      refUpdate.setExpectedOldObjectId(head);
      refUpdate.setNewObjectId(commit);
View Full Code Here

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

          commit.getTree());
      checkout.setFailOnConflict(false);
      try {
        checkout.checkout();
      } catch (org.eclipse.jgit.errors.CheckoutConflictException cce) {
        throw new CheckoutConflictException(checkout.getConflicts(),
            cce);
      }
    } finally {
      dc.unlock();
    }
View Full Code Here

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

        }
      }
    } catch (org.eclipse.jgit.errors.CheckoutConflictException e) {
      List<String> conflicts = (dco == null) ? Collections
          .<String> emptyList() : dco.getConflicts();
      throw new CheckoutConflictException(conflicts, e);
    } catch (IOException e) {
      throw new JGitInternalException(
          MessageFormat.format(
              JGitText.get().exceptionCaughtDuringExecutionOfMergeCommand,
              e), e);
View Full Code Here

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

        try {
          dco.checkout();
        } catch (org.eclipse.jgit.errors.CheckoutConflictException e) {
          status = new CheckoutResult(Status.CONFLICTS,
              dco.getConflicts());
          throw new CheckoutConflictException(dco.getConflicts(), e);
        }
      } finally {
        dc.unlock();
      }
      Ref ref = repo.getRef(name);
View Full Code Here

Examples of org.eclipse.jgit.errors.CheckoutConflictException

      else
        prescanOneTree();

      if (!conflicts.isEmpty()) {
        if (failOnConflict)
          throw new CheckoutConflictException(conflicts.toArray(new String[conflicts.size()]));
        else
          cleanUpConflicts();
      }

      // update our index
View Full Code Here

Examples of org.eclipse.jgit.errors.CheckoutConflictException

  private void cleanUpConflicts() throws CheckoutConflictException {
    // TODO: couldn't we delete unsaved worktree content here?
    for (String c : conflicts) {
      File conflict = new File(repo.getWorkTree(), c);
      if (!conflict.delete())
        throw new CheckoutConflictException(MessageFormat.format(
            JGitText.get().cannotDeleteFile, c));
      removeEmptyParents(conflict);
    }
    for (String r : removed) {
      File file = new File(repo.getWorkTree(), r);
      if (!file.delete())
        throw new CheckoutConflictException(
            MessageFormat.format(JGitText.get().cannotDeleteFile,
                file.getAbsolutePath()));
      removeEmptyParents(file);
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.CheckoutConflictException

      prescanOneTree();

    if (!conflicts.isEmpty()) {
      if (failOnConflict) {
        dc.unlock();
        throw new CheckoutConflictException(conflicts.toArray(new String[conflicts.size()]));
      } else
        cleanUpConflicts();
    }

    // update our index
View Full Code Here

Examples of org.eclipse.jgit.errors.CheckoutConflictException

  private void cleanUpConflicts() throws CheckoutConflictException {
    // TODO: couldn't we delete unsaved worktree content here?
    for (String c : conflicts) {
      File conflict = new File(repo.getWorkTree(), c);
      if (!conflict.delete())
        throw new CheckoutConflictException(MessageFormat.format(
            JGitText.get().cannotDeleteFile, c));
      removeEmptyParents(conflict);
    }
    for (String r : removed) {
      File file = new File(repo.getWorkTree(), r);
      if (!file.delete())
        throw new CheckoutConflictException(
            MessageFormat.format(JGitText.get().cannotDeleteFile,
                file.getAbsolutePath()));
      removeEmptyParents(file);
    }
  }
View Full Code Here

Examples of org.eclipse.jgit.errors.CheckoutConflictException

      prescanOneTree();

    if (!conflicts.isEmpty()) {
      if (failOnConflict) {
        dc.unlock();
        throw new CheckoutConflictException(conflicts.toArray(new String[conflicts.size()]));
      } else
        cleanUpConflicts();
    }

    // update our index
View Full Code Here

Examples of org.eclipse.jgit.errors.CheckoutConflictException

  private void cleanUpConflicts() throws CheckoutConflictException {
    // TODO: couldn't we delete unsaved worktree content here?
    for (String c : conflicts) {
      File conflict = new File(repo.getWorkTree(), c);
      if (!conflict.delete())
        throw new CheckoutConflictException(MessageFormat.format(
            JGitText.get().cannotDeleteFile, c));
      removeEmptyParents(conflict);
    }
    for (String r : removed) {
      File file = new File(repo.getWorkTree(), r);
      if (!file.delete())
        throw new CheckoutConflictException(
            MessageFormat.format(JGitText.get().cannotDeleteFile,
                file.getAbsolutePath()));
      removeEmptyParents(file);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.