mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-31 04:02:00 -07:00
Fix leading slash bug when used with !
.
When writing paths like `!/foo` in gitignore files (or when using the -g/--glob flag), the presence of `!` would prevent the gitignore builder from noticing the leading slash, which causes absolute path matching to fail. Fixes #405
This commit is contained in:
@@ -1045,6 +1045,18 @@ clean!(regression_279, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
||||
assert_eq!(lines, "");
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/405
|
||||
clean!(regression_405, "test", ".", |wd: WorkDir, mut cmd: Command| {
|
||||
wd.create_dir("foo/bar");
|
||||
wd.create_dir("bar/foo");
|
||||
wd.create("foo/bar/file1.txt", "test");
|
||||
wd.create("bar/foo/file2.txt", "test");
|
||||
cmd.arg("-g").arg("!/foo/**");
|
||||
|
||||
let lines: String = wd.stdout(&mut cmd);
|
||||
assert_eq!(lines, "bar/foo/file2.txt:test\n");
|
||||
});
|
||||
|
||||
// See: https://github.com/BurntSushi/ripgrep/issues/7
|
||||
sherlock!(feature_7, "-fpat", "sherlock", |wd: WorkDir, mut cmd: Command| {
|
||||
wd.create("pat", "Sherlock\nHolmes");
|
||||
|
Reference in New Issue
Block a user