Skip to content

Commit 1d4c063

Browse files
mjcheethamdscho
authored andcommitted
git.c: permit repack cmd in Scalar repos
Loosen the blocking of the `repack` command from all "GVFS repos" (those that have `core.gvfs` set) to only those that actually use the virtual file system (VFS for Git only). This allows for `repack` to be used in Scalar clones. Signed-off-by: Matthew John Cheetham <[email protected]>
1 parent 191035c commit 1d4c063

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

git.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ static struct cmd_struct commands[] = {
686686
{ "remote", cmd_remote, RUN_SETUP },
687687
{ "remote-ext", cmd_remote_ext, NO_PARSEOPT },
688688
{ "remote-fd", cmd_remote_fd, NO_PARSEOPT },
689-
{ "repack", cmd_repack, RUN_SETUP | BLOCK_ON_GVFS_REPO },
689+
{ "repack", cmd_repack, RUN_SETUP | BLOCK_ON_VFS_ENABLED },
690690
{ "replace", cmd_replace, RUN_SETUP },
691691
{ "replay", cmd_replay, RUN_SETUP },
692692
{ "rerere", cmd_rerere, RUN_SETUP },

t/t0402-block-command-on-gvfs.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ not_with_gvfs fsck
2222
not_with_gvfs gc
2323
not_with_gvfs gc --auto
2424
not_with_gvfs prune
25-
not_with_gvfs repack
2625
not_with_gvfs submodule status
2726
not_with_gvfs update-index --index-version 2
2827
not_with_gvfs update-index --skip-worktree
@@ -36,4 +35,14 @@ test_expect_success 'test gc --auto succeeds when disabled via config' '
3635
git gc --auto
3736
'
3837

38+
test_expect_success 'test repack fails with VFS bit enabled' '
39+
test_config core.gvfs true &&
40+
test_must_fail git repack
41+
'
42+
43+
test_expect_success 'test repack succeeds with VFS bit disabled' '
44+
test_config core.gvfs 150 &&
45+
git repack
46+
'
47+
3948
test_done

0 commit comments

Comments
 (0)