summaryrefslogtreecommitdiff
path: root/Command/Smudge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-24 13:15:26 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-24 13:15:26 -0400
commita9b36eb958b2dec1cefefe92262965b0f7dceb27 (patch)
treea26a6b703bbce84e8201c865daef9aa715074e84 /Command/Smudge.hs
parent3399d9faf4a519200bb42107cb7b0e4c3e2a92bc (diff)
lost some bookkeeping info
I forgot to convert this to use Annex.Ingest, todo later.
Diffstat (limited to 'Command/Smudge.hs')
-rw-r--r--Command/Smudge.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Command/Smudge.hs b/Command/Smudge.hs
index 5666381b0..bde440f7e 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 ()