Include executable extension in core.virtualfilesystem path#2038
Merged
tyrielv merged 1 commit intoJul 1, 2026
Conversation
git invokes core.virtualfilesystem via the shell (use_shell=1 in virtualfilesystem.c), so on Windows the shell has to probe PATHEXT candidates (.COM, .EXE, ...) to resolve the bare "virtual-filesystem" path to the actual "virtual-filesystem.exe" file that HooksInstaller writes to disk. Since VFSForGit controls both the config value and the file it points to, append GVFSPlatform.Instance.Constants.ExecutableExtension so the path matches the file exactly, avoiding repeated PATHEXT probing on every hook invocation. This is a no-op on platforms where ExecutableExtension is empty (macOS/Linux). Assisted-by: Claude Sonnet 5 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
KeithIsSleeping
approved these changes
Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
core.virtualfilesystemis set to an absolute path without a file extension, even though VFSForGit is the one that writes the corresponding hook executable (with the platform-specific extension) to.git/hooks/.Because git invokes
core.virtualfilesystemvia the shell (use_shell=1invirtualfilesystem.c), on Windows this meanscmd.exehas to probePATHEXTcandidates (.COM,.EXE, ...) to resolve the barevirtual-filesystempath to the actualvirtual-filesystem.exefile on every hook invocation.Since VFSForGit controls both the config value and the file it points to, this change appends
GVFSPlatform.Instance.Constants.ExecutableExtensionto the path — matching whatHooksInstalleralready does when writing the file — so the shell can exec the file directly without probing. This is a no-op on macOS/Linux, whereExecutableExtensionis empty.Testing
dotnet build src\GVFS\GVFS.UnitTests\GVFS.UnitTests.csproj -c DebugGVFS.UnitTests.exe: 876 passed, 0 failed (11 skipped tests are unrelated native-hook-exe checks that require a full native build).