summaryrefslogtreecommitdiff
path: root/Annex/Content.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-02-18 02:39:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-02-18 02:39:40 -0400
commit7573e6395924f394d529bbbcefe545074c181767 (patch)
tree060474f5ead9bae680689460c4d6ae0379c01595 /Annex/Content.hs
parentdb27cde123c4b2fd0e46f7f2a097e7a42451d844 (diff)
hlint
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r--Annex/Content.hs21
1 files changed, 10 insertions, 11 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index 4cb6a5ac8..871cedc42 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -81,7 +81,7 @@ inAnnex' isgood bad check key = withObjectLoc key checkindirect checkdirect
{- A safer check; the key's content must not only be present, but
- is not in the process of being removed. -}
inAnnexSafe :: Key -> Annex (Maybe Bool)
-inAnnexSafe = inAnnex' (maybe False id) (Just False) go
+inAnnexSafe = inAnnex' (fromMaybe False) (Just False) go
where
go f = liftIO $ openforlock f >>= check
openforlock f = catchMaybeIO $
@@ -240,15 +240,14 @@ checkDiskSpace destination key alreadythere = do
moveAnnex :: Key -> FilePath -> Annex ()
moveAnnex key src = withObjectLoc key storeobject storedirect
where
- storeobject dest = do
- ifM (liftIO $ doesFileExist dest)
- ( liftIO $ removeFile src
- , do
- createContentDir dest
- liftIO $ moveFile src dest
- freezeContent dest
- freezeContentDir dest
- )
+ storeobject dest = ifM (liftIO $ doesFileExist dest)
+ ( liftIO $ removeFile src
+ , do
+ createContentDir dest
+ liftIO $ moveFile src dest
+ freezeContent dest
+ freezeContentDir dest
+ )
storedirect fs = storedirect' =<< filterM validsymlink fs
validsymlink f = (==) (Just key) <$> isAnnexLink f
@@ -278,7 +277,7 @@ replaceFile file a = do
- If this happens, runs the rollback action and returns False. The
- rollback action should remove the data that was transferred.
-}
-sendAnnex :: Key -> (Annex ()) -> (FilePath -> Annex Bool) -> Annex Bool
+sendAnnex :: Key -> Annex () -> (FilePath -> Annex Bool) -> Annex Bool
sendAnnex key rollback sendobject = go =<< prepSendAnnex key
where
go Nothing = return False