From 293ef80eaf0641bcfa0206e1fc142017296bac8c Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Fri, 10 Oct 2025 21:06:01 -0400 Subject: [PATCH] test: add another regression test for gitignore matching bug I believe this was also fixed by #2933. Closes #2770 --- CHANGELOG.md | 1 + tests/regression.rs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a88201..91d2994 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Bug fixes: * [BUG #829](https://github.com/BurntSushi/ripgrep/issues/829), [BUG #2731](https://github.com/BurntSushi/ripgrep/issues/2731), [BUG #2747](https://github.com/BurntSushi/ripgrep/issues/2747), + [BUG #2770](https://github.com/BurntSushi/ripgrep/issues/2770), [BUG #2778](https://github.com/BurntSushi/ripgrep/issues/2778), [BUG #2836](https://github.com/BurntSushi/ripgrep/issues/2836), [BUG #2933](https://github.com/BurntSushi/ripgrep/pull/2933), diff --git a/tests/regression.rs b/tests/regression.rs index 83323cd..8a7e3a4 100644 --- a/tests/regression.rs +++ b/tests/regression.rs @@ -1455,6 +1455,21 @@ rgtest!(r2658_null_data_line_regexp, |dir: Dir, mut cmd: TestCommand| { eqnice!("haystack:bar\0", got); }); +// See: https://github.com/BurntSushi/ripgrep/issues/2770 +rgtest!(r2770_gitignore_error, |dir: Dir, _cmd: TestCommand| { + dir.create(".git", ""); + dir.create(".gitignore", "**/bar/*"); + dir.create_dir("foo/bar"); + dir.create("foo/bar/baz", "quux"); + + dir.command().arg("-l").arg("quux").assert_err(); + dir.command() + .current_dir(dir.path().join("foo")) + .arg("-l") + .arg("quux") + .assert_err(); +}); + // See: https://github.com/BurntSushi/ripgrep/pull/2944 rgtest!(r2944_incorrect_bytes_searched, |dir: Dir, mut cmd: TestCommand| { dir.create("haystack", "foo1\nfoo2\nfoo3\nfoo4\nfoo5\n");