Skip to main content

may_apply

Function may_apply 

Source
pub fn may_apply(pattern: &[u8], base: &[u8], path: &[u8]) -> bool
Expand description

What: Whether the pattern of an attributes line in the directory base may apply to the file path; a spelling the matcher does not model (a quote, an escape, a bracket class, **, a trailing slash), or whose comparison would exceed the work budget, answers yes. Why: Answering yes refuses a file that Git might not have matched; answering no for a file it matches would accept one.

In TS you’d write (pseudocode):

function mayApply(pattern: Buffer, base: Buffer, path: Buffer): boolean;