{"version":"2.1.280","anchor":"windowsmacos-aware-checks-added-to-the-git-write-path-safet","canonical_anchor":"windowsmacos-aware-checks-added-to-the-git-write-path-safet","heading":"Symlink-safety checks for git file writes now handle platform differences and cache OS support","tier":"internal","area":"Git Integration","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.280\/e\/windowsmacos-aware-checks-added-to-the-git-write-path-safet","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.280","markdown":"### Symlink-safety checks for git file writes now handle platform differences and cache OS support\n\nThe safety check that reopens a file before writing git-tracked content now branches by OS and caches whether macOS supports the no-follow open flag.\n\n**What**\n\n- The function that reopens a file to confirm it's still what git expects before writing now branches by platform: Windows uses `fs.stat` plus a plain open instead of `O_NOFOLLOW`, macOS gets its own no-follow flag handling, and there's an upfront check that the path is actually one git writes to.\n\n- On macOS, the open path now probes once (`Nmo()`) for whether the extended `O_NOFOLLOW` variant is supported, falling back to plain flags if not, instead of retrying after hitting an `EINVAL` error each time.\n\n- That probe result is now cached per-process (as \"untried\"\/\"works\"\/\"rejected\"), so once macOS is known not to support it, the code stops attempting it on every call.\n\n**Why**\n\nThis avoids repeatedly hitting the same OS error on every file open and keeps the symlink-safety guard working correctly across Windows, macOS, and other platforms.\n\n- Area: Git Integration\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}