Package org.eclipse.jgit.dircache

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


            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())
              .setAuthor(srcCommit.getAuthorIdent()).call();
          cherryPickedRefs.add(src);
        } else {
View Full Code Here


      DirCacheCheckout dco = new DirCacheCheckout(repo, headCommit
          .getTree(), 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

          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

      RevCommit commit = walk.parseCommit(repo.resolve(commitId));
      // no head in order to reset --hard
      DirCacheCheckout 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

    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

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

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

  private RevCommit parseCommit(final Repository repo, final Ref ref)
      throws MissingObjectException, IncorrectObjectTypeException,
      IOException {
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

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.