Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCacheCheckout.checkout()


      if (merger.merge(headCommit, stashCommit)) {
        DirCache dc = repo.lockDirCache();
        DirCacheCheckout dco = new DirCacheCheckout(repo, headTree,
            dc, merger.getResultTreeId());
        dco.setFailOnConflict(true);
        dco.checkout(); // Ignoring failed deletes....
        if (applyIndex) {
          ResolveMerger ixMerger = (ResolveMerger) strategy
              .newMerger(repo, true);
          ixMerger.setCommitNames(new String[] { "stashed HEAD",
              "HEAD", "stashed index" });
View Full Code Here


    u.setNewObjectId(commit);
    u.forceUpdate();

    DirCache dc = db.lockDirCache();
    DirCacheCheckout co = new DirCacheCheckout(db, dc, commit.getTree());
    co.checkout();
  }

  private RevCommit parseCommit(final Ref branch)
      throws MissingObjectException, IncorrectObjectTypeException,
      IOException {
View Full Code Here

    try {
      DirCacheCheckout checkout = new DirCacheCheckout(repo, dc,
          commitTree);
      checkout.setFailOnConflict(false);
      try {
        checkout.checkout();
      } catch (org.eclipse.jgit.errors.CheckoutConflictException cce) {
        throw new CheckoutConflictException(checkout.getConflicts(),
            cce);
      }
    } finally {
View Full Code Here

      CorruptObjectException, IOException {
    DirCacheCheckout dc;
    dc = new DirCacheCheckout(db, null, db.lockDirCache(),
        commit.getTree());
    dc.setFailOnConflict(true);
    assertTrue(dc.checkout());
    return dc;
  }

  private void assertIndex(HashMap<String, String> i)
      throws CorruptObjectException, IOException {
View Full Code Here

      try {
        dco = new DirCacheCheckout(repo, headTree, dc,
            newCommit.getTree());
        dco.setFailOnConflict(true);
        try {
          dco.checkout();
        } catch (org.eclipse.jgit.errors.CheckoutConflictException e) {
          status = new CheckoutResult(Status.CONFLICTS,
              dco.getConflicts());
          throw new CheckoutConflictException(dco.getConflicts(), e);
        }
View Full Code Here

            // index as a detached HEAD
            DirCacheCheckout co = new DirCacheCheckout(
                submoduleRepo, submoduleRepo.lockDirCache(),
                commit.getTree());
            co.setFailOnConflict(true);
            co.checkout();
            RefUpdate refUpdate = submoduleRepo.updateRef(
                Constants.HEAD, true);
            refUpdate.setNewObjectId(commit);
            refUpdate.forceUpdate();
          }
View Full Code Here

            continue;
          DirCacheCheckout dco = new DirCacheCheckout(repo,
              newHead.getTree(), repo.lockDirCache(),
              merger.getResultTreeId());
          dco.setFailOnConflict(true);
          dco.checkout();
          if (!noCommit)
            newHead = new Git(getRepository()).commit()
                .setMessage(srcCommit.getFullMessage())
                .setReflogComment(reflogPrefix + " " //$NON-NLS-1$
                    + srcCommit.getShortMessage())
View Full Code Here

            continue;
          DirCacheCheckout dco = new DirCacheCheckout(repo,
              headCommit.getTree(), repo.lockDirCache(),
              merger.getResultTreeId());
          dco.setFailOnConflict(true);
          dco.checkout();
          newHead = new Git(getRepository()).commit()
              .setMessage(newMessage)
              .setReflogComment("revert: " + shortMessage).call(); //$NON-NLS-1$
          revertedRefs.add(src);
          headCommit = newHead;
View Full Code Here

          JGitText.get().cannotRebaseWithoutCurrentHead);
    DirCache dc = repo.lockDirCache();
    try {
      DirCacheCheckout dco = new DirCacheCheckout(repo, dc, headTree);
      dco.setFailOnConflict(false);
      boolean needsDeleteFiles = dco.checkout();
      if (needsDeleteFiles) {
        List<String> fileList = dco.getToBeDeleted();
        for (String filePath : fileList) {
          File fileToDelete = new File(repo.getWorkTree(), filePath);
          if (repo.getFS().exists(fileToDelete))
View Full Code Here

      } else {
        dco = new DirCacheCheckout(repo, repo.lockDirCache(),
            commit.getTree());
      }
      dco.setFailOnConflict(false);
      dco.checkout();
      walk.release();
    } finally {
      monitor.endTask();
    }
    try {
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.