minor optimisation and warning fix

This commit is contained in:
Joey Hess 2013-05-20 13:58:41 -04:00
parent 94ab82bad8
commit 4c22c2261f

View file

@ -206,9 +206,10 @@ toDirectGen k f = do
{- Removes a direct mode file, while retaining its content in the annex. -}
removeDirect :: Key -> FilePath -> Annex ()
removeDirect k f = do
locs <- removeAssociatedFile k f
unlessM (inAnnex k) $
moveAnnex k f
otherlocs <- removeAssociatedFile k f
unless (null otherlocs) $
unlessM (inAnnex k) $
moveAnnex k f
liftIO $ do
nukeFile f
void $ tryIO $ removeDirectory $ parentDir f