-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
bugA bug.A bug.gitignoreBugs related to gitignore problems.Bugs related to gitignore problems.iceboxA feature that is recognized as possibly desirable, but is unlikely to implemented any time soon.A feature that is recognized as possibly desirable, but is unlikely to implemented any time soon.
Description
ripgrep seems to ignore unintended files when the base directory is not the current directory.
How to reproduce:
% mkdir -p ../test/foo
% echo '.*' >../test/.gitignore
% echo baz >../test/foo/bar
% rg baz ../test
../test/foo/bar
1:baz
% rg baz ../test/foo
No files were searched, which means ripgrep probably applied a filter you didn't expect. Try running again with --debug.
I found the following lines in ignore/src/dir.rs don't make sense because path on the right side is a relative path from the current directory, not from abs_parent_path.
339 if let Some(abs_parent_path) = self.absolute_base() {
340 let path = abs_parent_path.join(path);
A possible fix to run the example above correctly is the following. However, I'm not sure this fixes other cases.
let path = path.canonicalize().unwrap()
Metadata
Metadata
Assignees
Labels
bugA bug.A bug.gitignoreBugs related to gitignore problems.Bugs related to gitignore problems.iceboxA feature that is recognized as possibly desirable, but is unlikely to implemented any time soon.A feature that is recognized as possibly desirable, but is unlikely to implemented any time soon.