Gracefully handle when linked worktree .git path is outside worktree root (#53443)

In `update_git_repositories`, a `.git` path outside the worktree root
can occur legitimately when `.git` is a gitfile (as in linked worktrees
and submodules) pointing to a directory in the parent repo. Previously
this triggered a `debug_panic!`, crashing debug builds.

Now we skip the path with a `debug_assert!` that it is indeed a file
(not a directory), so a genuine `.git` directory outside the worktree
root would still be caught in debug builds.

(No release notes because this is extremely hard to encounter until
https://github.com/zed-industries/zed/pull/53215 lands)

Release Notes:

- N/A
fb949ae831Richard Feldman committed on 4/8/2026, 7:51:05 PM· committed by GitHubparent525f10a
2 files changedLine totals unavailable