Fix handling of git repositories with an external git directory (#55402)

Closes https://github.com/zed-industries/zed/issues/54824

Previously, we always assumed that `gitdir` was an absolute path. Also,
we did not correctly handle custom gitignore files that were configured
via separate git directories.

Release Notes:

- Fixed failure to recognize git repositories where `gitdir` was
expressed as a relative path.
- Fixed handling of gitignores in git repositories that use a separate
git dir.
42f9420437Max Brunsfeld committed on 5/4/2026, 4:20:25 PM· committed by GitHubparent8f2ab51
2 files changedLine totals unavailable