summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Annex/Direct.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index 1db046e7b..6d9f3e31d 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -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