summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2019-01-23 18:12:35 -0500
committerAndrew Gallant <jamslam@gmail.com>2019-01-23 18:12:35 -0500
commit23be3cf850386ec0d4d8724fb9bf5ddeaab2c27d (patch)
tree667cb25777094c7b296a1004f3f0f2df0de85526 /tests
parentb48bbf527d9d533a6636fa829ee466ea4130f3a0 (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/regression.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regression.rs b/tests/regression.rs
index 8102fd90..e4da2f1c 100644
--- a/tests/regression.rs
+++ b/tests/regression.rs
@@ -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();
+});