minor optimisation and warning fix
This commit is contained in:
parent
94ab82bad8
commit
4c22c2261f
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue