Module org.eclipse.jgit
Class ChangedPathFilter
java.lang.Object
org.eclipse.jgit.internal.storage.commitgraph.ChangedPathFilter
A changed path filter for a commit.
- Since:
- 6.7
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe minimum bits per entry, as described in man gitformat-commit-graph(5).static final ChangedPathFilterA filter that matches every path.static final intThe number of times a path is hashed, as described in man gitformat-commit-graph(5). -
Method Summary
Modifier and TypeMethodDescriptionstatic ChangedPathFilterfromFile(byte[] data, int offset, int length) Returns a filter read from a file.static ChangedPathFilterfromPaths(Set<ByteBuffer> paths) Returns a filter that matches all given paths.booleanmaybeContains(byte[] path) Checks if this changed path filter could contain path.voidWrites this filter to the given stream.
-
Field Details
-
PATH_HASH_COUNT
public static final int PATH_HASH_COUNTThe number of times a path is hashed, as described in man gitformat-commit-graph(5). The value of this constant is the only value JGit currently supports.- See Also:
-
BITS_PER_ENTRY
public static final int BITS_PER_ENTRYThe minimum bits per entry, as described in man gitformat-commit-graph(5). The value of this constant is the only value JGit currently supports.- See Also:
-
FULL
A filter that matches every path.
-
-
Method Details
-
fromPaths
Returns a filter that matches all given paths.Because of the nature of Bloom filters, this filter may also match paths not in the given set.
- Parameters:
paths- the paths that the filter must match- Returns:
- the corresponding filter
-
fromFile
Returns a filter read from a file.- Parameters:
data- data (read from a commit graph file)offset- offset into datalength- length of data- Returns:
- the corresponding filter
-
maybeContains
public boolean maybeContains(byte[] path) Checks if this changed path filter could contain path.- Parameters:
path- path to check existence of- Returns:
- true if the filter could contain path, false if the filter definitely does not contain path
-
writeTo
Writes this filter to the given stream.- Parameters:
s- stream to write to
-