You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sparse-checkout: require starting '/' in cone mode patterns
Add check for missing initial '/' when verifying cone patterns in
`add_pattern_to_hashsets(...)`, disabling cone patterns if not found. Update
tests in `t1091-sparse-checkout-builtin.sh` to ensure the starting '/' is
present unless the test verifies behavior when it is missing.
The implicit assumption of a starting '/' in cone mode patterns exists
throughout the code paths of `git sparse-checkout`, including in the
construction of the sparse pattern hashmaps. However, without enforcement of
that assumption, the presence of a directory pattern missing the starting
'/' would cause any subsequent cone mode `git sparse-checkout add` to enter
an infinite recursive loop in `insert_recursive_pattern(...)`
(`sparse-checkout.c`). By adding the starting '/' requirement to
`add_pattern_to_hashsets(...)` (`dir.c`), cone mode is disabled on the
pattern list, forcing `git sparse-checkout add` to exit early.
Signed-off-by: Victoria Dye <[email protected]>
0 commit comments