forked from git-for-windows/git
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gvfs: block unsupported commands when running in a GVFS repo
The following commands and options are not currently supported when working in a GVFS repo. Add code to detect and block these commands from executing. 1) fsck 2) gc 4) prune 5) repack 6) submodule 8) update-index --split-index 9) update-index --index-version (other than 4) 10) update-index --[no-]skip-worktree 11) worktree Signed-off-by: Ben Peart <benpeart@microsoft.com>
- Loading branch information
Showing
5 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
test_description='block commands in GVFS repo' | ||
|
||
. ./test-lib.sh | ||
|
||
not_with_gvfs () { | ||
command=$1 && | ||
shift && | ||
test_expect_success "test $command $*" " | ||
test_config alias.g4rbled $command && | ||
test_config core.gvfs true && | ||
test_must_fail git $command $* && | ||
test_must_fail git g4rbled $* && | ||
test_unconfig core.gvfs && | ||
test_must_fail git -c core.gvfs=true $command $* && | ||
test_must_fail git -c core.gvfs=true g4rbled $* | ||
" | ||
} | ||
|
||
not_with_gvfs fsck | ||
not_with_gvfs gc | ||
not_with_gvfs gc --auto | ||
not_with_gvfs prune | ||
not_with_gvfs repack | ||
not_with_gvfs submodule status | ||
not_with_gvfs update-index --index-version 2 | ||
not_with_gvfs update-index --skip-worktree | ||
not_with_gvfs update-index --no-skip-worktree | ||
not_with_gvfs update-index --split-index | ||
not_with_gvfs worktree list | ||
|
||
test_expect_success 'test gc --auto succeeds when disabled via config' ' | ||
test_config core.gvfs true && | ||
test_config gc.auto 0 && | ||
git gc --auto | ||
' | ||
|
||
test_done |