From 7c02f070b10eeaca26bfc3a4f554bbccada0997b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 24 Dec 2015 13:15:26 -0400 Subject: [PATCH] lost some bookkeeping info I forgot to convert this to use Annex.Ingest, todo later. --- Command/Smudge.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Command/Smudge.hs b/Command/Smudge.hs index 5666381b05..bde440f7ee 100644 --- a/Command/Smudge.hs +++ b/Command/Smudge.hs @@ -14,6 +14,7 @@ import Annex.Link import Annex.MetaData import Annex.FileMatcher import Annex.InodeSentinal +import Annex.Ingest import Utility.InodeCache import Types.KeySource import Backend @@ -74,7 +75,7 @@ clean file = do if isJust (parseLinkOrPointer b) then liftIO $ B.hPut stdout b else ifM (shouldAnnex file) - ( liftIO . emitPointer =<< ingest file + ( liftIO . emitPointer =<< ingestLocal file , liftIO $ B.hPut stdout b ) stop @@ -84,8 +85,9 @@ shouldAnnex file = do matcher <- largeFilesMatcher checkFileMatcher matcher file -ingest :: FilePath -> Annex Key -ingest file = do +-- TODO: Use main ingest code instead? +ingestLocal :: FilePath -> Annex Key +ingestLocal file = do backend <- chooseBackend file ic <- withTSDelta (liftIO . genInodeCache file) let source = KeySource @@ -105,6 +107,8 @@ ingest file = do LinkAnnexNoop -> noop genMetaData k file =<< liftIO (getFileStatus file) + cleanOldKeys file k + Database.Keys.addAssociatedFile k file return k emitPointer :: Key -> IO ()