didn't quite get removeDirect right before, this passes test suite
This commit is contained in:
parent
46eb1ea1e7
commit
d88be65495
2 changed files with 19 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue