aboutsummaryrefslogtreecommitdiff
path: root/Checks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Checks.hs')
-rw-r--r--Checks.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Checks.hs b/Checks.hs
index 3757abb27..92e9f7e38 100644
--- a/Checks.hs
+++ b/Checks.hs
@@ -14,6 +14,7 @@ import Common.Annex
import Types.Command
import Init
import Config
+import qualified Git
commonChecks :: [CommandCheck]
commonChecks = [repoExists]
@@ -25,6 +26,10 @@ notDirect :: Command -> Command
notDirect = addCheck $ whenM isDirect $
error "You cannot run this subcommand in a direct mode repository."
+notBareRepo :: Command -> Command
+notBareRepo = addCheck $ whenM (fromRepo Git.repoIsLocalBare) $
+ error "You cannot run this subcommand in a bare repository."
+
dontCheck :: CommandCheck -> Command -> Command
dontCheck check cmd = mutateCheck cmd $ \c -> filter (/= check) c