MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / permission_bits_matter

Function permission_bits_matter

atomic-core/src/output/attribute.rs:81–83  ·  view source on GitHub ↗

Whether a mode difference between an expected and an observed inode is a reportable fact. A symlink's permission bits are not: POSIX ignores them, Git stores every link as `120000`, and `lstat` reports `0o777` on Linux but `0o755` on macOS, so comparing them reports a phantom change on one platform or the other. A kind change to or from a symlink is still a type change.

(expected: InodeKind, observed: InodeKind)

Source from the content-addressed store, hash-verified

79/// macOS, so comparing them reports a phantom change on one platform or the
80/// other. A kind change to or from a symlink is still a type change.
81pub fn permission_bits_matter(expected: InodeKind, observed: InodeKind) -> bool {
82 expected != InodeKind::Symlink && observed != InodeKind::Symlink
83}
84
85/// Compare only permissions the current platform can observe. Windows' file
86/// metadata exposes a readonly bit, not POSIX executable/group/other bits.

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected