class documentation

Filter that uses a sparse specification from an object.

This filter reads sparse-checkout patterns from a blob object and uses them to determine which paths should be included in the partial clone.

Method __init__ Initialize sparse OID filter.
Method __repr__ Return string representation of the filter.
Method should_include_blob Include all blobs (sparse filtering is path-based, not size-based).
Method should_include_path Determine if a path should be included based on sparse patterns.
Method should_include_tree Include all trees (sparse filtering is path-based).
Method to_spec_string Return 'sparse:oid=<oid>'.
Instance Variable oid Undocumented
Method _load_patterns Load and parse sparse patterns from the blob.
Instance Variable _object_store Undocumented
Instance Variable _patterns Undocumented
def __init__(self, oid: ObjectID, object_store: BaseObjectStore | None = None):

Initialize sparse OID filter.

Parameters
oid:ObjectIDObject ID of the sparse specification blob
object_store:BaseObjectStore | NoneOptional object store to load the sparse patterns from
def __repr__(self) -> str:

Return string representation of the filter.

def should_include_blob(self, blob_size: int) -> bool:

Include all blobs (sparse filtering is path-based, not size-based).

def should_include_path(self, path: str) -> bool:

Determine if a path should be included based on sparse patterns.

Parameters
path:strPath to check (e.g., 'src/file.py')
Returns
boolTrue if the path matches the sparse patterns, False otherwise
def should_include_tree(self, depth: int) -> bool:

Include all trees (sparse filtering is path-based).

def to_spec_string(self) -> str:

Return 'sparse:oid=<oid>'.

oid =

Undocumented

def _load_patterns(self):

Load and parse sparse patterns from the blob.

_object_store =

Undocumented

_patterns: list[tuple[str, bool, bool, bool]] | None =

Undocumented