This is a special filter that performs AND(path, ANY_DIFF), but also
triggers rename detection so that the path node is updated to include a prior
file name as the RevWalk traverses history.
The renames found will be reported to a
org. if one is set.
Results with this filter are unpredictable if the path being followed is a subdirectory.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final DiffConfig | |
| private final PathFilter | |
| private RenameCallback |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public TreeFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| public static FollowFilter | Returns: a new filter for the requested path.the path to filter on. Must not be the empty string. All
trailing '/' characters will be trimmed before string's length
is checked or is used as part of the constructed filter. path, DiffConfig diff config specifying rename detection options. cfg)Create a new tree filter for a user supplied path. |
| public String | |
| public Optional | getPathsBestEffort()
Overrides org. If this filter checks that at least one of the paths in a set has been modified, returns that set of paths to be checked against a changed path filter. |
| public RenameCallback | Returns: the callback to which renames are reported, ornull
if noneGet the callback to which renames are reported. |
| public boolean | include(TreeWalk
the walker the filter needs to examine. walker)Implements abstract org. Determine if the current entry is interesting to report. |
| public void | setRenameCallback(RenameCallback
the callback to use callback)Sets the callback to which renames shall be reported. |
| 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. |
| cfg | back to summary |
|---|---|
| pack-priv final DiffConfig cfg | |
| path | back to summary |
|---|---|
| private final PathFilter path | |
| renameCallback | back to summary |
|---|---|
| private RenameCallback renameCallback | |
| FollowFilter | back to summary |
|---|---|
| pack-priv FollowFilter(PathFilter path, DiffConfig cfg) | |
| 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.
| |
| create | back to summary |
|---|---|
| public static FollowFilter create(String path, DiffConfig cfg) Create a new tree filter for a user supplied path. Path strings are relative to the root of the repository. If the user's input should be assumed relative to a subdirectory of the repository the caller must prepend the subdirectory's path prior to creating the filter. Path strings use '/' to delimit directories on all platforms.
| |
| getPath | back to summary |
|---|---|
| public String getPath() Get the path this filter matches.
| |
| getPathsBestEffort | back to summary |
|---|---|
| public Optional Overrides org. Doc from org. If this filter checks that at least one of the paths in a set has been modified, returns that set of paths to be checked against a changed path filter. Otherwise, returns empty. | |
| getRenameCallback | back to summary |
|---|---|
| public RenameCallback getRenameCallback() Get the callback to which renames are reported.
| |
| include | back to summary |
|---|---|
| public boolean include(TreeWalk walker) 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
| |
| setRenameCallback | back to summary |
|---|---|
| public void setRenameCallback(RenameCallback callback) Sets the callback to which renames shall be reported.
| |
| 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-
| |