diff options
author | Joey Hess <joey@kitenet.net> | 2012-03-14 17:43:34 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-03-14 17:43:34 -0400 |
commit | 60ab3d84e188b8dd3a284d962df25bbee41ff1cb (patch) | |
tree | 768d4f632bab0152dbc1ca72f81fc3b9c7915c0a /Command/PreCommit.hs | |
parent | a4f72c9625486786a4549cf4db1b542ea89da7c7 (diff) |
added ifM and nuked 11 lines of code
no behavior changes
Diffstat (limited to 'Command/PreCommit.hs')
-rw-r--r-- | Command/PreCommit.hs | 8 |
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 |