summaryrefslogtreecommitdiff
path: root/Annex/Direct.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Direct.hs')
-rw-r--r--Annex/Direct.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index 77a544257..e44081639 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -209,3 +209,11 @@ removeDirect k f = do
liftIO $ do
nukeFile f
void $ catchMaybeIO $ removeDirectory $ parentDir f
+
+{- Called when a direct mode file has been changed. Its old content may be
+ - lost. -}
+changedDirect :: Key -> FilePath -> Annex ()
+changedDirect oldk f = do
+ locs <- removeAssociatedFile oldk f
+ whenM (pure (null locs) <&&> not <$> inAnnex oldk) $
+ logStatus oldk InfoMissing