summaryrefslogtreecommitdiff
path: root/Command/PreCommit.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/PreCommit.hs')
-rw-r--r--Command/PreCommit.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs
index b0328ca19..06140fa52 100644
--- a/Command/PreCommit.hs
+++ b/Command/PreCommit.hs
@@ -7,6 +7,7 @@
module Command.PreCommit where
+import Common.Annex
import Command
import qualified Command.Add
import qualified Command.Fix
@@ -26,7 +27,6 @@ start file = next $ perform file
perform :: FilePath -> CommandPerform
perform file = do
- ok <- doCommand $ Command.Add.start file
- if ok
- then next $ return True
- else error $ "failed to add " ++ file ++ "; canceling commit"
+ unlessM (doCommand $ Command.Add.start file) $
+ error $ "failed to add " ++ file ++ "; canceling commit"
+ next $ return True