rename for clarity

Associated files are recorded now also for locked files, but this is
only needed to populate unlocked files.
This commit is contained in:
Joey Hess 2021-06-14 10:55:24 -04:00
parent 8f66f73fea
commit 673b2feaf3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -179,7 +179,7 @@ ingest' preferredbackend meterupdate (Just (LockedDown cfg source)) mk restage =
golocked key mcache s = golocked key mcache s =
tryNonAsync (moveAnnex key naf (contentLocation source)) >>= \case tryNonAsync (moveAnnex key naf (contentLocation source)) >>= \case
Right True -> do Right True -> do
populateAssociatedFiles key source restage populateUnlockedFiles key source restage
success key mcache s success key mcache s
Right False -> giveup "failed to add content to annex" Right False -> giveup "failed to add content to annex"
Left e -> restoreFile (keyFilename source) key e Left e -> restoreFile (keyFilename source) key e
@ -221,11 +221,11 @@ finishIngestUnlocked' :: Key -> KeySource -> Restage -> Annex ()
finishIngestUnlocked' key source restage = do finishIngestUnlocked' key source restage = do
Database.Keys.addAssociatedFile key Database.Keys.addAssociatedFile key
=<< inRepo (toTopFilePath (keyFilename source)) =<< inRepo (toTopFilePath (keyFilename source))
populateAssociatedFiles key source restage populateUnlockedFiles key source restage
{- Copy to any other locations using the same key. -} {- Copy to any unlocked files using the same key. -}
populateAssociatedFiles :: Key -> KeySource -> Restage -> Annex () populateUnlockedFiles :: Key -> KeySource -> Restage -> Annex ()
populateAssociatedFiles key source restage = do populateUnlockedFiles key source restage = do
obj <- calcRepo (gitAnnexLocation key) obj <- calcRepo (gitAnnexLocation key)
g <- Annex.gitRepo g <- Annex.gitRepo
ingestedf <- flip fromTopFilePath g ingestedf <- flip fromTopFilePath g