Skip to content

Commit c335e49

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 <mjcheetham@outlook.com>
1 parent 4320650 commit c335e49

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
@@ -713,7 +713,7 @@ static struct cmd_struct commands[] = {
713713
{ "remote", cmd_remote, RUN_SETUP },
714714
{ "remote-ext", cmd_remote_ext, NO_PARSEOPT },
715715
{ "remote-fd", cmd_remote_fd, NO_PARSEOPT },
716-
{ "repack", cmd_repack, RUN_SETUP | BLOCK_ON_GVFS_REPO },
716+
{ "repack", cmd_repack, RUN_SETUP | BLOCK_ON_VFS_ENABLED },
717717
{ "replace", cmd_replace, RUN_SETUP },
718718
{ "replay", cmd_replay, RUN_SETUP },
719719
{ "repo", cmd_repo, 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)