Fix browsing subdirectories containing submodules

Existing code causes a NullReferenceException when browsing a subdirectory containing a submodule. This is because existing code incorrectly tries to read the .gitmodules file from that subdirectory instead of the repository root.