Directly parse .git when it's a file instead of using libgit2 (#27885)

Avoids building a whole git2 repository object at the worktree layer
just to watch some additional paths.

- [x] Tidy up names of the various paths
- [x] Tests for worktrees and submodules

Release Notes:

- N/A
055df30757Cole Miller committed on 4/12/2025, 12:35:14 AM· committed by GitHubparent429d458
7 files changedLine totals unavailable