Package org.eclipse.jgit.dircache

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


      } 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

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

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

      if (headId == null) {
        revWalk.parseHeaders(srcCommit);
        dco = new DirCacheCheckout(repo,
            repo.lockDirCache(), srcCommit.getTree());
        dco.setFailOnConflict(true);
        dco.checkout();
        RefUpdate refUpdate = repo
            .updateRef(head.getTarget().getName());
        refUpdate.setNewObjectId(objectId);
        refUpdate.setExpectedOldObjectId(null);
        refUpdate.setRefLogMessage("initial pull", false);
View Full Code Here

        refLogMessage.append(": " + MergeStatus.FAST_FORWARD);
        dco = new DirCacheCheckout(repo,
            headCommit.getTree(), repo.lockDirCache(),
            srcCommit.getTree());
        dco.setFailOnConflict(true);
        dco.checkout();
        String msg = null;
        ObjectId newHead, base = null;
        MergeStatus mergeStatus = null;
        if (!squash) {
          updateHead(refLogMessage, srcCommit, headId);
View Full Code Here

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

          String msg = null;
          RevCommit newHead = null;
          MergeStatus mergeStatus = null;
          if (!squash) {
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

    try {
      DirCacheCheckout checkout = new DirCacheCheckout(repo, dc,
          commit.getTree());
      checkout.setFailOnConflict(false);
      try {
        checkout.checkout();
      } catch (org.eclipse.jgit.errors.CheckoutConflictException cce) {
        throw new CheckoutConflictException(checkout.getConflicts(),
            cce);
      }
    } finally {
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

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

  private Ref findBranchToCheckout(FetchResult result) {
    final Ref idHEAD = result.getAdvertisedRef(Constants.HEAD);
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.