Skip to content

Commit 278487e

Browse files
mjcheethamdscho
authored andcommitted
worktree: remove special case GVFS cmd blocking
Replace the special casing of the `worktree` command being blocked on VFS-enabled repos with the new `BLOCK_ON_VFS_ENABLED` flag. Signed-off-by: Matthew John Cheetham <[email protected]>
1 parent 3832df9 commit 278487e

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

builtin/worktree.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,13 +1451,6 @@ int cmd_worktree(int ac,
14511451

14521452
repo_config(the_repository, git_worktree_config, NULL);
14531453

1454-
/*
1455-
* git-worktree is special-cased to work in Scalar repositories
1456-
* even when they use the GVFS Protocol.
1457-
*/
1458-
if (gvfs_config_is_set(repo, GVFS_USE_VIRTUAL_FILESYSTEM))
1459-
die("'git %s' is not supported on a GVFS repo", "worktree");
1460-
14611454
if (!prefix)
14621455
prefix = "";
14631456

git.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct
543543
if (!help && p->option & BLOCK_ON_GVFS_REPO && gvfs_config_is_set(repo, GVFS_BLOCK_COMMANDS))
544544
die("'git %s' is not supported on a GVFS repo", p->cmd);
545545

546-
if (!help && p->option & BLOCK_ON_VFS_ENABLED && gvfs_config_is_set(GVFS_USE_VIRTUAL_FILESYSTEM))
546+
if (!help && p->option & BLOCK_ON_VFS_ENABLED && gvfs_config_is_set(repo, GVFS_USE_VIRTUAL_FILESYSTEM))
547547
die("'git %s' is not supported when using the virtual file system", p->cmd);
548548

549549
if (run_pre_command_hook(the_repository, argv))
@@ -729,7 +729,7 @@ static struct cmd_struct commands[] = {
729729
#ifndef WITH_BREAKING_CHANGES
730730
{ "whatchanged", cmd_whatchanged, RUN_SETUP },
731731
#endif
732-
{ "worktree", cmd_worktree, RUN_SETUP },
732+
{ "worktree", cmd_worktree, RUN_SETUP | BLOCK_ON_VFS_ENABLED },
733733
{ "write-tree", cmd_write_tree, RUN_SETUP },
734734
};
735735

0 commit comments

Comments
 (0)