Class ChangedPathFilter

java.lang.Object
org.eclipse.jgit.internal.storage.commitgraph.ChangedPathFilter

public class ChangedPathFilter extends Object
A changed path filter for a commit.
Since:
6.7
  • Field Details

    • PATH_HASH_COUNT

      public static final int PATH_HASH_COUNT
      The 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_ENTRY
      The 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

      public static final ChangedPathFilter FULL
      A filter that matches every path.
  • Method Details

    • fromPaths

      public static ChangedPathFilter fromPaths(Set<ByteBuffer> paths)
      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

      public static ChangedPathFilter fromFile(byte[] data, int offset, int length)
      Returns a filter read from a file.
      Parameters:
      data - data (read from a commit graph file)
      offset - offset into data
      length - 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

      public void writeTo(ByteArrayOutputStream s)
      Writes this filter to the given stream.
      Parameters:
      s - stream to write to