Skip to content

worktree: conditionally allow worktree on VFS-enabled repos#868

Open
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/gvfs-worktree
Open

worktree: conditionally allow worktree on VFS-enabled repos#868
tyrielv wants to merge 1 commit intomicrosoft:vfs-2.53.0from
tyrielv:tyrielv/gvfs-worktree

Conversation

@tyrielv
Copy link

@tyrielv tyrielv commented Mar 12, 2026

Add GVFS_SUPPORTS_WORKTREES flag (1<<8) to core.gvfs bitmask. When set, allow git worktree commands to run on VFS-enabled repos instead of blocking them with BLOCK_ON_VFS_ENABLED.

Force --no-checkout during worktree add when VFS is active so ProjFS can be mounted before files are projected.

Support skip-clean-check marker file in worktree gitdir: if .git/worktrees//skip-clean-check exists, skip the cleanliness check during worktree remove. This allows VFSForGit's pre-command hook to unmount ProjFS after its own status check, then let git proceed without re-checking (which would fail without the virtual filesystem).

The corresponding change in VFSForGit is microsoft/VFSForGit#1911

  • This change only applies to the virtualization hook and VFS for Git.

Add GVFS_SUPPORTS_WORKTREES flag (1<<8) to core.gvfs bitmask. When set,
allow git worktree commands to run on VFS-enabled repos instead of
blocking them with BLOCK_ON_VFS_ENABLED.

Force --no-checkout during worktree add when VFS is active so ProjFS can
be mounted before files are projected.

Support skip-clean-check marker file in worktree gitdir: if
.git/worktrees/<name>/skip-clean-check exists, skip the cleanliness
check during worktree remove. This allows VFSForGit's pre-command hook
to unmount ProjFS after its own status check, then let git proceed
without re-checking (which would fail without the virtual filesystem).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv tyrielv marked this pull request as ready for review March 12, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant