32
32
#define DELAY_PAGER_CONFIG (1<<4)
33
33
#define NO_PARSEOPT (1<<5) /* parse-options is not used */
34
34
#define BLOCK_ON_GVFS_REPO (1<<6) /* command not allowed in GVFS repos */
35
+ #define BLOCK_ON_VFS_ENABLED (1<<7) /* command not allowed when virtual file system is used */
35
36
36
37
struct cmd_struct {
37
38
const char * cmd ;
@@ -542,6 +543,9 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv, struct
542
543
if (!help && p -> option & BLOCK_ON_GVFS_REPO && gvfs_config_is_set (repo , GVFS_BLOCK_COMMANDS ))
543
544
die ("'git %s' is not supported on a GVFS repo" , p -> cmd );
544
545
546
+ if (!help && p -> option & BLOCK_ON_VFS_ENABLED && gvfs_config_is_set (repo , GVFS_USE_VIRTUAL_FILESYSTEM ))
547
+ die ("'git %s' is not supported when using the virtual file system" , p -> cmd );
548
+
545
549
if (run_pre_command_hook (the_repository , argv ))
546
550
die ("pre-command hook aborted command" );
547
551
@@ -626,7 +630,7 @@ static struct cmd_struct commands[] = {
626
630
{ "for-each-ref" , cmd_for_each_ref , RUN_SETUP },
627
631
{ "for-each-repo" , cmd_for_each_repo , RUN_SETUP_GENTLY },
628
632
{ "format-patch" , cmd_format_patch , RUN_SETUP },
629
- { "fsck" , cmd_fsck , RUN_SETUP | BLOCK_ON_GVFS_REPO },
633
+ { "fsck" , cmd_fsck , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
630
634
{ "fsck-objects" , cmd_fsck , RUN_SETUP },
631
635
{ "fsmonitor--daemon" , cmd_fsmonitor__daemon , RUN_SETUP },
632
636
{ "gc" , cmd_gc , RUN_SETUP },
@@ -669,7 +673,7 @@ static struct cmd_struct commands[] = {
669
673
{ "pack-refs" , cmd_pack_refs , RUN_SETUP },
670
674
{ "patch-id" , cmd_patch_id , RUN_SETUP_GENTLY | NO_PARSEOPT },
671
675
{ "pickaxe" , cmd_blame , RUN_SETUP },
672
- { "prune" , cmd_prune , RUN_SETUP | BLOCK_ON_GVFS_REPO },
676
+ { "prune" , cmd_prune , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
673
677
{ "prune-packed" , cmd_prune_packed , RUN_SETUP },
674
678
{ "pull" , cmd_pull , RUN_SETUP | NEED_WORK_TREE },
675
679
{ "push" , cmd_push , RUN_SETUP },
@@ -682,7 +686,7 @@ static struct cmd_struct commands[] = {
682
686
{ "remote" , cmd_remote , RUN_SETUP },
683
687
{ "remote-ext" , cmd_remote_ext , NO_PARSEOPT },
684
688
{ "remote-fd" , cmd_remote_fd , NO_PARSEOPT },
685
- { "repack" , cmd_repack , RUN_SETUP | BLOCK_ON_GVFS_REPO },
689
+ { "repack" , cmd_repack , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
686
690
{ "replace" , cmd_replace , RUN_SETUP },
687
691
{ "replay" , cmd_replay , RUN_SETUP },
688
692
{ "rerere" , cmd_rerere , RUN_SETUP },
@@ -725,7 +729,7 @@ static struct cmd_struct commands[] = {
725
729
#ifndef WITH_BREAKING_CHANGES
726
730
{ "whatchanged" , cmd_whatchanged , RUN_SETUP },
727
731
#endif
728
- { "worktree" , cmd_worktree , RUN_SETUP | BLOCK_ON_GVFS_REPO },
732
+ { "worktree" , cmd_worktree , RUN_SETUP | BLOCK_ON_VFS_ENABLED },
729
733
{ "write-tree" , cmd_write_tree , RUN_SETUP },
730
734
};
731
735
0 commit comments