Package org.eclipse.jgit.dircache

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


      RevCommit head = walk.parseCommit(repo.resolve(Constants.HEAD));
      DirCacheCheckout dco = new DirCacheCheckout(repo, head.getTree(),
          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);
View Full Code Here


      merger.setWorkingTreeIterator(new FileTreeIterator(repo));
      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" });
          ixMerger.setBase(stashHeadCommit);
          boolean ok = ixMerger.merge(headCommit, stashIndexCommit);
View Full Code Here

         {
            DirCacheCheckout dco = new DirCacheCheckout(repo,
                     headCommit.getTree(), repo.lockDirCache(),
                     merger.getResultTreeId());
            dco.setFailOnConflict(true);
            dco.checkout();

            cherryPickedRefs.add(src);
         }
         else
         {
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(srcCommit.getFullMessage())
              .setReflogComment(
                  "cherry-pick: "
                      + srcCommit.getShortMessage())
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 (fileToDelete.exists())
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

    try {
      RevCommit head = walk.parseCommit(repo.resolve(Constants.HEAD));
      DirCacheCheckout dco = new DirCacheCheckout(repo, head.getTree(),
          repo.lockDirCache(), commit.getTree());
      dco.setFailOnConflict(true);
      dco.checkout();
      // update the HEAD
      RefUpdate refUpdate = repo.updateRef(Constants.HEAD, true);
      refUpdate.setExpectedOldObjectId(head);
      refUpdate.setNewObjectId(commit);
      Result res = refUpdate.forceUpdate();
View Full Code Here

    if (!bare) {
      DirCache dc = clonedRepo.lockDirCache();
      DirCacheCheckout co = new DirCacheCheckout(clonedRepo, dc,
          commit.getTree());
      co.checkout();
      if (cloneSubmodules)
        cloneSubmodules(clonedRepo);
    }
  }
View Full Code Here

         {
            DirCacheCheckout dco = new DirCacheCheckout(repo,
                     headCommit.getTree(), repo.lockDirCache(),
                     merger.getResultTreeId());
            dco.setFailOnConflict(true);
            dco.checkout();

            cherryPickedRefs.add(src);
         }
         else
         {
View Full Code Here

      throws MissingObjectException, IncorrectObjectTypeException,
      IOException, GitAPIException {
      DirCache dc = clonedRepo.lockDirCache();
      DirCacheCheckout co = new DirCacheCheckout(clonedRepo, dc,
          commit.getTree());
      co.checkout();
      if (cloneSubmodules)
        cloneSubmodules(clonedRepo);
  }

  protected void cloneSubmodules(Repository clonedRepo) throws IOException,
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.