You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify permission preservation to follow Git's approach
Following the reviewer's suggestion, this commit simplifies Unix permission
handling to only preserve the owner executable bit, matching Git's approach.
Git stores file permissions as either 100644 (non-executable) or 100755
(executable), focusing on the functional aspect (executability) while
ignoring platform-specific permission details that are generally irrelevant
for cross-platform builds.
Changes:
- permissionsToMode(): Only checks OWNER_EXECUTE permission, returns
0100755 if executable, 0100644 otherwise
- modeToPermissions(): Restores either rwxr-xr-x (0755) or rw-r--r-- (0644)
based on owner executable bit
Benefits:
- Simpler, more portable implementation
- Matches proven Git model for cross-platform permission handling
- Solves issue #214 (executable shell scripts) without over-engineering
- Avoids cache invalidation from irrelevant permission differences
All tests pass, including CacheUtilsPermissionsTest which verifies:
- Permission changes affect cache hash when preservePermissions=true
- Permissions are not preserved when preservePermissions=false
0 commit comments