diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-20 16:28:33 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-20 16:28:33 -0400 |
commit | c79c06e6c243b787afed7817ce1967015eacaf8a (patch) | |
tree | a7ee97440b480745094622dc0817615b3fc0651f /Annex/Direct.hs | |
parent | 9f31e14cc4154d2cb12a62eaf935a0c1528c709a (diff) |
didn't quite get removeDirect right before, this passes test suite
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r-- | Annex/Direct.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs index 6d9f3e31d..962c7595c 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -203,13 +203,16 @@ toDirectGen k f = do liftIO . void . copyFileExternal loc _ -> return Nothing -{- Removes a direct mode file, while retaining its content in the annex. -} +{- Removes a direct mode file, while retaining its content in the annex + - (unless its content has already been changed). -} removeDirect :: Key -> FilePath -> Annex () removeDirect k f = do - otherlocs <- removeAssociatedFile k f - unless (null otherlocs) $ - unlessM (inAnnex k) $ - moveAnnex k f + void $ removeAssociatedFileUnchecked k f + unlessM (inAnnex k) $ + ifM (goodContent k f) + ( moveAnnex k f + , logStatus k InfoMissing + ) liftIO $ do nukeFile f void $ tryIO $ removeDirectory $ parentDir f |