added ifM and nuked 11 lines of code

no behavior changes
This commit is contained in:
Joey Hess 2012-03-14 17:43:34 -04:00
parent a4f72c9625
commit 60ab3d84e1
17 changed files with 151 additions and 162 deletions

View file

@ -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