3333#define NO_PARSEOPT (1<<5) /* parse-options is not used */
3434#define DEPRECATED (1<<6)
3535#define BLOCK_ON_GVFS_REPO (1<<7) /* command not allowed in GVFS repos */
36+ #define BLOCK_ON_VFS_ENABLED (1<<8) /* command not allowed when virtual file system is used */
3637
3738struct cmd_struct {
3839 const char * cmd ;
@@ -568,6 +569,9 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct
568569 if (!help && p -> option & BLOCK_ON_GVFS_REPO && gvfs_config_is_set (repo , GVFS_BLOCK_COMMANDS ))
569570 die ("'git %s' is not supported on a GVFS repo" , p -> cmd );
570571
572+ if (!help && p -> option & BLOCK_ON_VFS_ENABLED && gvfs_config_is_set (repo , GVFS_USE_VIRTUAL_FILESYSTEM ))
573+ die ("'git %s' is not supported when using the virtual file system" , p -> cmd );
574+
571575 if (run_pre_command_hook (the_repository , argv ))
572576 die ("pre-command hook aborted command" );
573577
@@ -652,7 +656,7 @@ static struct cmd_struct commands[] = {
652656 { "for-each-ref" , cmd_for_each_ref , RUN_SETUP },
653657 { "for-each-repo" , cmd_for_each_repo , RUN_SETUP_GENTLY },
654658 { "format-patch" , cmd_format_patch , RUN_SETUP },
655- { "fsck" , cmd_fsck , RUN_SETUP | BLOCK_ON_GVFS_REPO },
659+ { "fsck" , cmd_fsck , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
656660 { "fsck-objects" , cmd_fsck , RUN_SETUP },
657661 { "fsmonitor--daemon" , cmd_fsmonitor__daemon , RUN_SETUP },
658662 { "gc" , cmd_gc , RUN_SETUP },
@@ -695,7 +699,7 @@ static struct cmd_struct commands[] = {
695699 { "pack-refs" , cmd_pack_refs , RUN_SETUP },
696700 { "patch-id" , cmd_patch_id , RUN_SETUP_GENTLY | NO_PARSEOPT },
697701 { "pickaxe" , cmd_blame , RUN_SETUP },
698- { "prune" , cmd_prune , RUN_SETUP | BLOCK_ON_GVFS_REPO },
702+ { "prune" , cmd_prune , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
699703 { "prune-packed" , cmd_prune_packed , RUN_SETUP },
700704 { "pull" , cmd_pull , RUN_SETUP | NEED_WORK_TREE },
701705 { "push" , cmd_push , RUN_SETUP },
@@ -708,7 +712,7 @@ static struct cmd_struct commands[] = {
708712 { "remote" , cmd_remote , RUN_SETUP },
709713 { "remote-ext" , cmd_remote_ext , NO_PARSEOPT },
710714 { "remote-fd" , cmd_remote_fd , NO_PARSEOPT },
711- { "repack" , cmd_repack , RUN_SETUP | BLOCK_ON_GVFS_REPO },
715+ { "repack" , cmd_repack , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
712716 { "replace" , cmd_replace , RUN_SETUP },
713717 { "replay" , cmd_replay , RUN_SETUP },
714718 { "rerere" , cmd_rerere , RUN_SETUP },
@@ -750,7 +754,7 @@ static struct cmd_struct commands[] = {
750754#ifndef WITH_BREAKING_CHANGES
751755 { "whatchanged" , cmd_whatchanged , RUN_SETUP | DEPRECATED },
752756#endif
753- { "worktree" , cmd_worktree , RUN_SETUP | BLOCK_ON_GVFS_REPO },
757+ { "worktree" , cmd_worktree , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
754758 { "write-tree" , cmd_write_tree , RUN_SETUP },
755759};
756760
0 commit comments