The has_permission_to_access function was incorrectly using absolute paths when checking against gitignore patterns. This could cause issues when the binary name matches the project root directory name, particularly in Go projects.
Changes:
- Extract relative path from absolute path by removing project root prefix
- Use relative path for gitignore pattern matching
- Add comments explaining the path handling logic
Signed-off-by: Hanchin Hsieh <me@yuchanns.xyz>