git-format-staged icon indicating copy to clipboard operation
git-format-staged copied to clipboard

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

Open Xyc2016 opened this issue 8 months ago • 1 comments

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))

Xyc2016 avatar Jun 19 '24 13:06 Xyc2016