org.eclipse.jgit.treewalk.filter.TreeFilter#ANY_DIFF which should be
used when among the walked trees there is a
org.eclipse.jgit.dircache.DirCacheIterator and a
org.eclipse.jgit.treewalk.WorkingTreeIterator . Please see the
documentation of org.eclipse.jgit.treewalk.filter.TreeFilter#ANY_DIFF
for a basic description of the semantics.
This filter tries to avoid computing content ids of the files in the
working-tree. In contrast to
org. this filter
takes care to first compare the entry from the
org. with the entries from all
other iterators besides the
org.. Since all those
entries have fast access to content ids that is very fast. If a difference is
detected in this step this filter decides to include that path before even
looking at the working-tree entry.
If no difference is found then we have to compare index and working-tree as
the last step. By making use of
org.
we can avoid the computation of the content id if the file is not dirty.
Instances of this filter should not be used for multiple
org.s. Always construct a new instance
of this filter for each TreeWalk.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final boolean | |
| private final Set | |
| private final ArrayDeque | |
| private final ArrayDeque | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | IndexDiffFilter(int
the index of the
dirCacheIndex, int org. in the
associated treewalkthe index of the
workingTreeIndex)org. in the
associated treewalkCreates a new instance of this filter. |
| public | IndexDiffFilter(int
the index of the
dirCacheIndex, int org. in the
associated treewalkthe index of the
workingTreeIndex, boolean org. in the
associated treewalktrue if the filter should skip working tree files that are
declared as ignored by the standard exclude mechanisms. honorIgnores)Creates a new instance of this filter. |
| Modifier and Type | Method and Description |
|---|---|
| public TreeFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| private void | copyUntrackedFolders(String
the current path of the treewalk currentPath)Copy all entries which are still in untrackedParentFolders and which belong to a path this treewalk has left into untrackedFolders. |
| public Set | |
| public List | Returns: all paths of folders which contain only untracked files/folders. If on the associated treewalk postorder traversal was turned on (seeorg.) then an
empty list will be returned.Getter for the field |
| public boolean | include(TreeWalk
the walker the filter needs to examine. tw)Implements abstract org. Determine if the current entry is interesting to report. |
| public boolean | shouldBeRecursive()
Implements abstract org. Does this tree filter require a recursive walk to match everything? |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| private WorkingTreeIterator |
| dirCache | back to summary |
|---|---|
| private final int dirCache | |
| honorIgnores | back to summary |
|---|---|
| private final boolean honorIgnores | |
| ignoredPaths | back to summary |
|---|---|
| private final Set<String> ignoredPaths | |
| untrackedFolders | back to summary |
|---|---|
| private final ArrayDeque<String> untrackedFolders | |
| untrackedParentFolders | back to summary |
|---|---|
| private final ArrayDeque<String> untrackedParentFolders | |
| workingTree | back to summary |
|---|---|
| private final int workingTree | |
| IndexDiffFilter | back to summary |
|---|---|
| public IndexDiffFilter(int dirCacheIndex, int workingTreeIndex) Creates a new instance of this filter. Do not use an instance of this filter in multiple treewalks.
| |
| IndexDiffFilter | back to summary |
|---|---|
| public IndexDiffFilter(int dirCacheIndex, int workingTreeIndex, boolean honorIgnores) Creates a new instance of this filter. Do not use an instance of this filter in multiple treewalks.
| |
| clone | back to summary |
|---|---|
| public TreeFilter clone() Implements abstract org. Doc from org. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.
| |
| copyUntrackedFolders | back to summary |
|---|---|
| private void copyUntrackedFolders(String currentPath) Copy all entries which are still in untrackedParentFolders and which belong to a path this treewalk has left into untrackedFolders. It is sure that we will not find any tracked files underneath these paths. Therefore these paths definitely belong to untracked folders.
| |
| getIgnoredPaths | back to summary |
|---|---|
| public Set The method returns the list of ignored files and folders. Only the root folder of an ignored folder hierarchy is reported. If a/b/c is listed in the .gitignore then you should not expect a/b/c/d/e/f to be reported here. Only a/b/c will be reported. Furthermore only ignored files / folders are returned that are NOT in the index. | |
| getUntrackedFolders | back to summary |
|---|---|
| public List Getter for the field
| |
| include | back to summary |
|---|---|
| public boolean include(TreeWalk tw) throws MissingObjectException, IncorrectObjectTypeException, IOException Implements abstract org. Doc from org. Determine if the current entry is interesting to report.
This method is consulted for subtree entries even if
| |
| shouldBeRecursive | back to summary |
|---|---|
| public boolean shouldBeRecursive() Implements abstract org. Doc from org. Does this tree filter require a recursive walk to match everything? If this tree filter is matching on full entry path names and its pattern is looking for a '/' then the filter would require a recursive TreeWalk to accurately make its decisions. The walker is not required to enable recursive behavior for any particular filter, this is only a hint.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| workingTree | back to summary |
|---|---|
| private WorkingTreeIterator workingTree(TreeWalk tw) | |