summaryrefslogtreecommitdiff
path: root/Command/Add.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/Add.hs
parentb400984ddf9aeb24c3d67e87cfeb29470618636c (diff)
refactor some boilerplate
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index b532ab045..29a1518e8 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -34,19 +34,19 @@ start :: CommandStartBackendFile
start pair@(file, _) = notAnnexed file $ do
s <- liftIO $ getSymbolicLinkStatus file
if (isSymbolicLink s) || (not $ isRegularFile s)
- then return Nothing
+ then stop
else do
showStart "add" file
- return $ Just $ perform pair
+ next $ perform pair
perform :: BackendFile -> CommandPerform
perform (file, backend) = do
stored <- Backend.storeFileKey file backend
case stored of
- Nothing -> return Nothing
+ Nothing -> stop
Just (key, _) -> do
moveAnnex key file
- return $ Just $ cleanup file key
+ next $ cleanup file key
cleanup :: FilePath -> Key -> CommandCleanup
cleanup file key = do