Examples of checkOut()


Examples of org.eclipse.jgit.api.Git.checkout()

            // Check branch
            boolean pull = true;
            String currentBranch = repository.getBranch();
            if (branch != null && !branch.equals(currentBranch)) {
                CheckoutCommand checkout = git.checkout();
                if (!branchExists(git, branch)) {
                    checkout.setCreateBranch(true);
                    pull = false;
                }
                checkout.setName(branch);
View Full Code Here

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

      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

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

        refLogMessage.append(": " + MergeStatus.FAST_FORWARD);
        dco = new DirCacheCheckout(repo,
            headCommit.getTree(), repo.lockDirCache(),
            srcCommit.getTree());
        dco.setFailOnConflict(true);
        dco.checkout();

        updateHead(refLogMessage, srcCommit, headId);
        setCallable(false);
        return new MergeResult(srcCommit, srcCommit, new ObjectId[] {
            headCommit, srcCommit }, MergeStatus.FAST_FORWARD,
View Full Code Here

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

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

          RevCommit newHead = new Git(getRepository()).commit()
              .setReflogComment(refLogMessage.toString()).call();
          return new MergeResult(newHead.getId(),
              null, new ObjectId[] {
View Full Code Here

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

    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

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

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

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

          // Checkout commit referenced in parent repository's 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

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())
              .setReflogComment(
                  "cherry-pick: "
                      + srcCommit.getShortMessage())
View Full Code Here

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

      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

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();
          String shortMessage = "Revert \"" + srcCommit.getShortMessage() + "\"";
          String newMessage = shortMessage + "\n\n"
              + "This reverts commit "
              + srcCommit.getId().getName() + ".\n";
          newHead = new Git(getRepository()).commit()
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.