fs: Remove redundant stat in RealFs metadata (#63190)

# Objective

This removes an extra filesystem metadata lookup from
`RealFs::metadata`.

On Unix, `is_executable` performs a full extra stat(2)
(std::fs::metadata) just to read `mode() & 0o111`, even though the mode
bits are already present in the `symlink_metadata` result. On Windows
its impl also starts with `self.exists()`, another stat. This costs one
extra syscall plus one extra executor spawn per entry during the
worktree background scan - I experienced millions of avoidable syscalls
on a large monorepo.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable


---

Release Notes:

- Improved worktree scan performance by removing redundant executable
checks.

---------

Co-authored-by: Hamish <hamishc@users.noreply.github.com>
ad51f6825cHamish Clark committed on 9/7/2026, 5:16:20 PM· committed by GitHubparente578430
2 files changedLine totals unavailable