Skip to content
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

Use cwd to resolve paths in Ignore::matched #962

Closed
wants to merge 2 commits into from

Conversation

tmccombs
Copy link
Contributor

Fixes #829 and #278.

This does change the Ignore struct to depend on the working directory at
the time of creation, I think this is fine, since Ignore isn't
publicly accessible and the Walk structs already depend on the current
working directory implicitly.

I tried to make a minimal change to fix the issue. An alternative
implementation could be to call current_dir in the matched_ignore
method instead of in add_parents, but I'm not sure of the performance
implications of doing that.

Another possible solution would be to change the places that we call
Ignore::matched to change the path to be relative to the absolute_base
of the Ignore.

Fixes BurntSushi#829 and BurntSushi#278.

This does change the Ignore struct to depend on the working directory at
the time of creation, I _think_ this is fine, since Ignore isn't
publicly accessible and the Walk structs already depend on the current
working directory implicitly.

I tried to make a minimal change to fix the issue. An alternative
implementation could be to call `current_dir` in the `matched_ignore`
method instead of in `add_parents`, but I'm not sure of the performance
implications of doing that.

Another possible solution would be to change the places that we call
`Ignore::matched` to change the path to be relative to the absolute_base
of the `Ignore`.
@BurntSushi
Copy link
Owner

#963 (comment)

@BurntSushi BurntSushi closed this Apr 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing a path argument doesn't respect .gitignore
2 participants