Harden Git sandbox metadata grants (#59785)

Agent terminal commands that request Git metadata access now verify
linked-worktree and submodule metadata before moving Git paths from
protected to writable sandbox paths. This prevents a mutated `.git`
gitfile from redirecting a grant to unrelated repository metadata while
preserving standard submodule layouts.

Release Notes:

- Improved agent terminal sandboxing for Git metadata access.

---------

Co-authored-by: Martin Ye <martin@zed.dev>
5d06fffd98Richard Feldman committed on 6/24/2026, 4:16:25 AM· committed by GitHubparentc49a29f
6 files changedLine totals unavailable