Skip to content

Commit 7f1a5a4

Browse files
authored
worktree remove: use gvfs_config_is_set for skip-clean-check gate (#875)
The skip-clean-check guard in remove_worktree() was gated on core_virtualfilesystem, which is only initialized by repo_config_get_virtualfilesystem() during index loading. Since the worktree remove path never loads the index before this check, the variable was always NULL, causing check_clean_worktree() to run even when VFSForGit had already unmounted the projection and written the skip-clean-check marker file. This made 'git worktree remove' fail with 'fatal: failed to run git status' in GVFS repos. Replace core_virtualfilesystem with gvfs_config_is_set(GVFS_USE_VIRTUAL_FILESYSTEM), which is already loaded from core.gvfs by cmd_worktree() before dispatch to remove_worktree().
2 parents c2d19e7 + 6c886e2 commit 7f1a5a4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

builtin/worktree.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,9 @@ static int remove_worktree(int ac, const char **av, const char *prefix,
14201420
strbuf_release(&errmsg);
14211421

14221422
if (file_exists(wt->path)) {
1423-
if (!force && !(core_virtualfilesystem && should_skip_clean_check(wt)))
1423+
if (!force &&
1424+
!(gvfs_config_is_set(the_repository, GVFS_SUPPORTS_WORKTREES) &&
1425+
should_skip_clean_check(wt)))
14241426
check_clean_worktree(wt, av[0]);
14251427

14261428
ret |= delete_git_work_tree(wt);

0 commit comments

Comments
 (0)