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

Why use fnmatch to match absolute paths instead of relative path? #109

Open
Xyc2016 opened this issue Jun 19, 2024 · 1 comment
Open

Why use fnmatch to match absolute paths instead of relative path? #109

Xyc2016 opened this issue Jun 19, 2024 · 1 comment

Comments

@Xyc2016
Copy link

Xyc2016 commented Jun 19, 2024

I am not familiar with system programming. And I want to rewrite the tool in Rust.
I am confused, why just

fnmatch(entry['src_path'], pattern)

instead of

fnmatch(normalize_path(entry['src_path'], relative_to=git_root), normalize_path(pattern))
@hallettj
Copy link
Owner

hallettj commented Jul 8, 2024

I think matching on relative paths is better - it looks like this was an oversight on my part

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

No branches or pull requests

2 participants