aboutsummaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Command.hs b/Command.hs
index 478dfdc39..6c127c15d 100644
--- a/Command.hs
+++ b/Command.hs
@@ -18,6 +18,7 @@ module Command (
whenAnnexed,
ifAnnexed,
notBareRepo,
+ notDirect,
isBareRepo,
numCopies,
numCopiesCheck,
@@ -103,6 +104,12 @@ notBareRepo a = do
error "You cannot run this subcommand in a bare repository."
a
+notDirect :: Annex a -> Annex a
+notDirect a = ifM isDirect
+ ( error "You cannot run this subcommand in a direct mode repository."
+ , a
+ )
+
isBareRepo :: Annex Bool
isBareRepo = fromRepo Git.repoIsLocalBare