summaryrefslogtreecommitdiff
path: root/Command/PreCommit.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-15 02:02:46 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-15 02:02:46 -0400
commit56bc3e95cabb85e5f23e30b453f90438c33efbb8 (patch)
treec13ac69cfc2b5ba9582aa5c1ebd427bc0d337b16 /Command/PreCommit.hs
parentb400984ddf9aeb24c3d67e87cfeb29470618636c (diff)
refactor some boilerplate
Diffstat (limited to 'Command/PreCommit.hs')
-rw-r--r--Command/PreCommit.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs
index 1db40f75f..d7f248713 100644
--- a/Command/PreCommit.hs
+++ b/Command/PreCommit.hs
@@ -27,13 +27,13 @@ seek = [withFilesToBeCommitted Command.Fix.start,
withFilesUnlockedToBeCommitted start]
start :: CommandStartBackendFile
-start pair = return $ Just $ perform pair
+start pair = next $ perform pair
perform :: BackendFile -> CommandPerform
perform pair@(file, _) = do
ok <- doCommand $ Command.Add.start pair
if ok
- then return $ Just $ cleanup file
+ then next $ cleanup file
else error $ "failed to add " ++ file ++ "; canceling commit"
cleanup :: FilePath -> CommandCleanup