1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/tests
Andrew Gallant 9c940b45f4
globset: permit ** to appear anywhere
Previously, `man gitignore` specified that `**` was invalid unless it
was used in one of a few specific circumstances, i.e., `**`, `a/**`,
`**/b` or `a/**/b`. That is, `**` always had to be surrounded by either
a path separator or the beginning/end of the pattern.

It turns out that git itself has treated `**` outside the above contexts
as valid for quite a while, so there was an inconsistency between the
spec `man gitignore` and the implementation, and it wasn't clear which
was actually correct.

@okdana filed a bug against git[1] and got this fixed. The spec was wrong,
which has now been fixed [2] and updated[2].

This commit brings ripgrep in line with git and treats `**` outside of
the above contexts as two consecutive `*` patterns. We deprecate the
`InvalidRecursive` error since it is no longer used.

Fixes #373, Fixes #1098

[1] - https://public-inbox.org/git/C16A9F17-0375-42F9-90A9-A92C9F3D8BBA@dana.is
[2] - 627186d020
[3] - https://git-scm.com/docs/gitignore
2019-01-23 19:59:39 -05:00
..
data grep-cli: support Brotli/Zstd decompression 2019-01-22 20:56:16 -05:00
feature.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
hay.rs tests: re-tool integration tests 2018-08-20 07:10:19 -04:00
json.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
macros.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
misc.rs grep-cli: support Brotli/Zstd decompression 2019-01-22 20:56:16 -05:00
multiline.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
regression.rs globset: permit ** to appear anywhere 2019-01-23 19:59:39 -05:00
tests.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
util.rs tests: touch up tests on Windows 2018-08-21 23:05:52 -04:00