@Override public WorkingTreeIterator getWorkingTreeIterator(Repository repo) { return new FileTreeIterator(repo); } };
/** * Constructs a DirCacheCeckout for checking out one tree, merging with the * index. As iterator over the working tree this constructor creates a * standard {@link org.eclipse.jgit.treewalk.FileTreeIterator} * * @param repo * the repository in which we do the checkout * @param dc * the (already locked) Dircache for this repo * @param mergeCommitTree * the id of the tree of the * @throws java.io.IOException */ public DirCacheCheckout(Repository repo, DirCache dc, ObjectId mergeCommitTree) throws IOException { this(repo, null, dc, mergeCommitTree, new FileTreeIterator(repo)); }
/** * Constructs a DirCacheCeckout for merging and checking out two trees (HEAD * and mergeCommitTree) and the index. As iterator over the working tree * this constructor creates a standard * {@link org.eclipse.jgit.treewalk.FileTreeIterator} * * @param repo * the repository in which we do the checkout * @param headCommitTree * the id of the tree of the head commit * @param dc * the (already locked) Dircache for this repo * @param mergeCommitTree * the id of the tree we want to fast-forward to * @throws java.io.IOException */ public DirCacheCheckout(Repository repo, ObjectId headCommitTree, DirCache dc, ObjectId mergeCommitTree) throws IOException { this(repo, headCommitTree, dc, mergeCommitTree, new FileTreeIterator(repo)); }
/** * Create a new iterator for the current entry's subtree. * <p> * The parent reference of the iterator must be <code>this</code>, otherwise * the caller would not be able to exit out of the subtree iterator * correctly and return to continue walking <code>this</code>. * * @return a new iterator that walks over the current subtree. * @since 5.0 */ protected AbstractTreeIterator enterSubtree() { return new FileTreeIterator(this, ((FileEntry) current()).getFile(), fs, fileModeStrategy); }
/** * {@inheritDoc} * <p> * Executes the {@code Status} command with all the options and parameters * collected by the setter methods of this class. Each instance of this * class should only be used for one invocation of the command. Don't call * this method twice on an instance. */ @Override public Status call() throws GitAPIException, NoWorkTreeException { if (workingTreeIt == null) workingTreeIt = new FileTreeIterator(repo); try { IndexDiff diff = new IndexDiff(repo, Constants.HEAD, workingTreeIt); if (ignoreSubmoduleMode != null) diff.setIgnoreSubmoduleMode(ignoreSubmoduleMode); if (paths != null) diff.setFilter(PathFilterGroup.createFromStrings(paths)); if (progressMonitor == null) diff.diff(); else diff.diff(progressMonitor, ProgressMonitor.UNKNOWN, ProgressMonitor.UNKNOWN, ""); //$NON-NLS-1$ return new Status(diff); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }
throws IOException { try (TreeWalk walk = new TreeWalk(db)) { walk.addTree(new FileTreeIterator(db)); PathFilter f = PathFilter.create(path); walk.setFilter(f);
@Override public WorkingTreeIterator getWorkingTreeIterator(Repository repo) { return new FileTreeIterator(repo); } };
public WorkingTreeIterator getWorkingTreeIterator(Repository repo) { return new FileTreeIterator(repo); } };
FileTreeIterator fIter = new FileTreeIterator(repository); walk.addTree(iIter); walk.addTree(fIter);
walk.addTree(new FileTreeIterator(repo)); walk.setRecursive(true);
try (NameConflictTreeWalk tw = new NameConflictTreeWalk(repo)) { int dciPos = tw.addTree(new DirCacheIterator(dc)); FileTreeIterator fti = new FileTreeIterator(repo); tw.addTree(fti); fti.setDirCacheIterator(tw, dciPos);
oldTree = new DirCacheIterator(repo.readDirCache()); if (newTree == null) newTree = new FileTreeIterator(repo);
treeWalk.addTree(headCommit.getTree()); treeWalk.addTree(new DirCacheIterator(cache)); treeWalk.addTree(new FileTreeIterator(repo)); treeWalk.getTree(2, FileTreeIterator.class) .setDirCacheIterator(treeWalk, 1);
@Override public AbstractTreeIterator createSubtreeIterator(final ObjectReader reader) throws IncorrectObjectTypeException, IOException { return new FileTreeIterator(this, ((FileEntry) current()).getFile(), fs, fileModeStrategy); }
int dcIdx = treeWalk .addTree(new DirCacheBuildIterator(existingBuilder)); FileTreeIterator fti = new FileTreeIterator(repo); fti.setDirCacheIterator(treeWalk, 0); int fIdx = treeWalk.addTree(fti);
resolveMerger.setCommitNames(new String[] { "BASE", "HEAD", ref.getName() }); //$NON-NLS-1$ //$NON-NLS-2$ resolveMerger.setWorkingTreeIterator(new FileTreeIterator(repo)); noProblems = merger.merge(headCommit, srcCommit); lowLevelResults = resolveMerger
merger.setWorkingTreeIterator(new FileTreeIterator(repo)); merger.setBase(srcCommit.getTree()); merger.setCommitNames(new String[] {
"stash" }); //$NON-NLS-1$ merger.setBase(stashHeadCommit); merger.setWorkingTreeIterator(new FileTreeIterator(repo)); boolean mergeSucceeded = merger.merge(headCommit, stashCommit); List<String> modifiedByMerge = merger.getModifiedFiles();
merger.setWorkingTreeIterator(new FileTreeIterator(repo)); merger.setBase(srcParent.getTree()); merger.setCommitNames(new String[] { "BASE", ourName, //$NON-NLS-1$
tw.addTree(new DirCacheBuildIterator(builder)); if (workingTreeIterator == null) workingTreeIterator = new FileTreeIterator(repo); workingTreeIterator.setDirCacheIterator(tw, 0); tw.addTree(workingTreeIterator);