-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--files doesn't correctly handle .gitignore'd directories when supplied paths are absolute #65
Comments
Nice find. This is a dupe of #16. |
(Fix incoming.) |
amsharma91
added a commit
to amsharma91/ripgrep
that referenced
this issue
Sep 27, 2016
We were erroneously neglecting to prefix a pattern like `foo/` with `**/` (to make `**/foo/`) because it had a slash in it. In fact, the only reason to neglect a **/ prefix is if the pattern already starts with **/, or if the pattern is absolute. Fixes BurntSushi#16, BurntSushi#49, BurntSushi#50, BurntSushi#65
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that specifying a path in a
.gitignore
which has a trailing slash, such as(as opposed to simply
a
) causesrg --files
to fail to correctly ignore files within that directory. This only happens when an absolute path is supplied as an argument.Steps to reproduce
Here's a shell session that shows the problem. In it I create a directory, ignore it, and then show that the files within that directory are correctly ignored if I run
rg --files
orrg --files ignored .
(see #64 for why I've included the wordignored
in that invocation), but not if I runrg --files ignored $PWD
.If I either specify the path as
.
, or remove the trailing slash from the line in.gitignore
, the directory is correctly ignored.The text was updated successfully, but these errors were encountered: