sparse-checkout: escape all glob characters on write
authorDerrick Stolee <redacted>
Fri, 31 Jan 2020 20:16:13 +0000 (20:16 +0000)
committerJunio C Hamano <redacted>
Fri, 31 Jan 2020 21:05:29 +0000 (13:05 -0800)
commite53ffe2704d7e10690f4382e46c1411a482531f1
tree7f3023dee345428454e54871094f1d9d51def9e9
parente55682ea2640dd3aa002a2657c32bdd1d85b44e9
sparse-checkout: escape all glob characters on write

The sparse-checkout patterns allow special globs according to
fnmatch(3). When writing cone-mode patterns for paths containing
these characters, they must be escaped.

Use is_glob_special() to check which characters must be escaped
this way, and add a path to the tests that contains all glob
characters at once. Note that ']' is not special, since the
initial bracket '[' is escaped.

Reported-by: Jeff King <redacted>
Signed-off-by: Derrick Stolee <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/sparse-checkout.c
t/t1091-sparse-checkout-builtin.sh
git clone https://git.99rst.org/PROJECT