]> git.ipfire.org Git - thirdparty/git.git/commit - dir.c
sparse-checkout: warn on globs in cone patterns
authorDerrick Stolee <dstolee@microsoft.com>
Fri, 31 Jan 2020 20:16:08 +0000 (20:16 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Jan 2020 21:05:29 +0000 (13:05 -0800)
commit9abc60f8015d060d3f3433b105648a4725c97bd1
tree367534ff77b191bf1edbfa24ef61496733332b40
parent9e6d3e64175713bc0007f3012ea288f4dfc0a399
sparse-checkout: warn on globs in cone patterns

In cone mode, the sparse-checkout commmand will write patterns that
allow faster pattern matching. This matching only works if the patterns
in the sparse-checkout file are those written by that command. Users
can edit the sparse-checkout file and create patterns that cause the
cone mode matching to fail.

The cone mode patterns may end in "/*" but otherwise an un-escaped
asterisk or other glob character is invalid. Add checks to disable
cone mode when seeing these values.

A later change will properly handle escaped globs.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
t/t1091-sparse-checkout-builtin.sh