Package org.eclipse.jgit.dircache

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


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

  private Ref findBranchToCheckout(FetchResult result) {
    Ref foundBranch = null;
View Full Code Here


      RevTree headTree = headCommit == null ? null : headCommit.getTree();
      DirCacheCheckout dco = new DirCacheCheckout(repo, headTree,
          repo.lockDirCache(), newCommit.getTree());
      dco.setFailOnConflict(true);
      try {
        dco.checkout();
      } catch (CheckoutConflictException e) {
        status = new CheckoutResult(Status.CONFLICTS, dco
            .getConflicts());
        throw e;
      }
View Full Code Here

    try {
      dc = repo.lockDirCache();
      DirCacheCheckout checkout = new DirCacheCheckout(repo, dc,
          commit.getTree());
      checkout.setFailOnConflict(false);
      checkout.checkout();
    } catch (IOException e) {
      throw e;
    } finally {
      if (dc != null)
        dc.unlock();
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

    RevWalk walk = new RevWalk(db);
    RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD));
    DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree(), db
        .lockDirCache(), commit.getTree());
    dco.setFailOnConflict(true);
    dco.checkout();
    walk.release();
    // update the HEAD
    RefUpdate refUpdate = db.updateRef(Constants.HEAD, true);
    refUpdate.setNewObjectId(commit);
    refUpdate.setRefLogMessage("checkout: moving to " + head.getName(),
View Full Code Here

    RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD));
    RevCommit branch = walk.parseCommit(db.resolve(branchName));
    DirCacheCheckout dco = new DirCacheCheckout(db, head.getTree().getId(),
        db.lockDirCache(), branch.getTree().getId());
    dco.setFailOnConflict(true);
    dco.checkout();
    walk.release();
    // update the HEAD
    RefUpdate refUpdate = db.updateRef(Constants.HEAD);
    refUpdate.setRefLogMessage("checkout: moving to " + branchName, false);
    refUpdate.link(branchName);
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

      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); //$NON-NLS-1$
View Full Code Here

        refLogMessage.append(": " + MergeStatus.FAST_FORWARD); //$NON-NLS-1$
        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;
          ObjectId newHeadId = null;
          MergeStatus mergeStatus = null;
          if (!commit && squash) {
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.