diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2020-01-25 00:19:37 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-25 00:26:54 +0300 |
commit | 9e6d3e64175713bc0007f3012ea288f4dfc0a399 (patch) | |
tree | 1117224847f0b0c6003eced2c04493a49bb5ca2c /t/t1091-sparse-checkout-builtin.sh | |
parent | 41de0c6fbcc3d2544ebada3a9f26dec0f32f42de (diff) |
sparse-checkout: detect short patterns
In cone mode, the shortest pattern the sparse-checkout command will
write into the sparse-checkout file is "/*". This is handled carefully
in add_pattern_to_hashsets(), so warn if any other pattern is this
short. This will assist future pattern checks by allowing us to assume
there are at least three characters in the pattern.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1091-sparse-checkout-builtin.sh')
-rwxr-xr-x | t/t1091-sparse-checkout-builtin.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh index e2e45dc7fd..2e57534799 100755 --- a/t/t1091-sparse-checkout-builtin.sh +++ b/t/t1091-sparse-checkout-builtin.sh @@ -339,4 +339,13 @@ test_expect_success 'pattern-checks: /A/**/B/' ' check_files repo/deep/deeper1 "deepest" ' +test_expect_success 'pattern-checks: too short' ' + cat >repo/.git/info/sparse-checkout <<-\EOF && + /* + !/*/ + /a + EOF + check_read_tree_errors repo "a" "disabling cone pattern matching" +' + test_done |