mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-25 17:21:57 -07:00
ignore: fix handling of **
When deciding whether to add the `**/` prefix or not, we should choose not to add it if the pattern is simply a bare `**`. Previously, we were only not adding it if it was `**/`, which is correct, but we also need to do it for `**` since `**` can already match anywhere. There's likely a more principled solution to this, but this works for now. Fixes #1173
This commit is contained in:
@@ -596,3 +596,11 @@ rgtest!(r1164, |dir: Dir, mut cmd: TestCommand| {
|
||||
cmd.arg("--no-ignore-file-case-insensitive").stdout()
|
||||
);
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/1173
|
||||
rgtest!(r1173, |dir: Dir, mut cmd: TestCommand| {
|
||||
dir.create_dir(".git");
|
||||
dir.create(".gitignore", "**");
|
||||
dir.create("foo", "test");
|
||||
cmd.arg("test").assert_err();
|
||||
});
|
||||
|
Reference in New Issue
Block a user