[pull] master from microsoft:master#109
Merged
Merged
Conversation
Worktree mounts shared the primary enlistment's .gvfs metadata (placeholder database, RepoMetadata, diagnostics, corrupt objects) instead of using their own per-worktree .gvfs directory. This caused stale file content after git reset --hard in worktrees, because placeholder tracking was shared with the primary mount. Root cause: code throughout the codebase derived .gvfs paths from EnlistmentRoot, which always resolves to the primary enlistment root even for worktree mounts. The correct property is DotGVFSRoot, which resolves to the per-worktree .gvfs for worktree mounts and the primary .gvfs for primary mounts. Product fixes: - GVFSDatabase: accept dotGVFSRoot directly instead of deriving from EnlistmentRoot; update InProcessMount, SparseVerb, DiskLayoutUpgrade, EnlistmentPathData, ProfilingEnvironment call sites - GitRepo: resolve DotGVFSRoot at construction for corrupt object paths - GVFSVerb.InitializeLocalCacheAndObjectsPaths: use DotGVFSRoot for RepoMetadata (affects dehydrate, prefetch) - DiagnoseVerb: use DotGVFSRoot for .gvfs file collection and RepoMetadata initialization - CacheVerb: use DotGVFSRoot for RepoMetadata - RequiredGitConfig: narrow parameter to GVFSEnlistment, use DotGVFSRoot - GVFSLogsRoot: derive from DotGVFSRoot instead of re-deriving - GitMaintenanceStep: check WorkingDirectoryRoot for existence - HooksInstaller: use WorkingDirectoryRoot in error messages Rename to prevent recurrence: - Rename Enlistment.EnlistmentRoot to PrimaryEnlistmentRoot, forcing every caller to explicitly choose the right path property. Audit of all ~280 references across ~75 files confirmed each usage is correct. Test: - Add WorktreeUsesPerWorktreePlaceholderDatabase functional test Assisted-by: Claude Opus 4.6 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
fix worktree mounts using primary enlistment's .gvfs paths
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )