class documentation

class Pattern:

Constructor: Pattern(pattern)

View In Hierarchy

A single gitattributes pattern.

Method __init__ Initialize GitAttributesPattern.
Method match Check if path matches this pattern.
Instance Variable pattern Undocumented
Method _compile Compile the pattern to a regular expression.
Instance Variable _regex Undocumented
def __init__(self, pattern: bytes):

Initialize GitAttributesPattern.

Parameters
pattern:bytesAttribute pattern as bytes
def match(self, path: bytes) -> bool:

Check if path matches this pattern.

Parameters
path:bytesPath to check (relative to repository root, using / separators)
Returns
boolTrue if path matches this pattern
pattern =

Undocumented

def _compile(self):

Compile the pattern to a regular expression.

_regex: re.Pattern[bytes] | None =

Undocumented