Skip to content

[pull] master from microsoft:master#109

Merged
pull[bot] merged 2 commits into
cgallred:masterfrom
microsoft:master
Jun 3, 2026
Merged

[pull] master from microsoft:master#109
pull[bot] merged 2 commits into
cgallred:masterfrom
microsoft:master

Conversation

@pull

@pull pull Bot commented Jun 3, 2026

Copy link
Copy Markdown

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 : )

tyrielv added 2 commits June 3, 2026 12:00
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
@pull pull Bot locked and limited conversation to collaborators Jun 3, 2026
@pull pull Bot added the ⤵️ pull label Jun 3, 2026
@pull pull Bot merged commit 73e8e29 into cgallred:master Jun 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant