lost some bookkeeping info

I forgot to convert this to use Annex.Ingest, todo later.
This commit is contained in:
Joey Hess 2015-12-24 13:15:26 -04:00
parent 9d3474ef1b
commit 7c02f070b1
Failed to extract signature

View file

@ -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 ()