private void checkOptions() { if (checkoutStage != null && !isCheckoutIndex()) throw new IllegalStateException( JGitText.get().cannotCheckoutOursSwitchBranch); } }
if (!checkoutAllPaths) treeWalk.setFilter(PathFilterGroup.createFromStrings(paths)); if (isCheckoutIndex()) checkoutPathsFromIndex(treeWalk, dc); else {
private void checkOptions() { if (checkoutStage != null && !isCheckoutIndex()) throw new IllegalStateException( JGitText.get().cannotCheckoutOursSwitchBranch); } }
private void checkOptions() { if (checkoutStage != null && !isCheckoutIndex()) throw new IllegalStateException( JGitText.get().cannotCheckoutOursSwitchBranch); } }
/** * Checkout paths into index and working directory * * @return this instance * @throws IOException * @throws RefNotFoundException */ protected CheckoutCommand checkoutPaths() throws IOException, RefNotFoundException { DirCache dc = repo.lockDirCache(); try (RevWalk revWalk = new RevWalk(repo); TreeWalk treeWalk = new TreeWalk(repo, revWalk.getObjectReader())) { treeWalk.setRecursive(true); if (!checkoutAllPaths) treeWalk.setFilter(PathFilterGroup.createFromStrings(paths)); if (isCheckoutIndex()) checkoutPathsFromIndex(treeWalk, dc); else { RevCommit commit = revWalk.parseCommit(getStartPointObjectId()); checkoutPathsFromCommit(treeWalk, dc, commit); } } finally { dc.unlock(); } return this; }
if (!checkoutAllPaths) treeWalk.setFilter(PathFilterGroup.createFromStrings(paths)); if (isCheckoutIndex()) checkoutPathsFromIndex(treeWalk, dc); else {