verify associated files when checking numcopies

Most of this is just refactoring. But, handleDropsFrom
did not verify that associated files from the keys db were still
accurate, and has now been fixed to.

A minor improvement to this would be to avoid calling catKeyFile
twice on the same file, when getting the numcopies and mincopies value,
in the common case where the same file has the highest value for both.
But, it avoids checking every associated file, so it will scale well to
lots of dups already.

Sponsored-by: Kevin Mueller on Patreon
This commit is contained in:
Joey Hess 2021-06-15 11:12:27 -04:00
parent d164434679
commit af9fdf5dba
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 68 additions and 10 deletions

View file

@ -15,3 +15,10 @@ differently than in a non-bare repo. (Also if this is done, the preferred
content checking should also behave the same way.) The docs for --all
do say that it bypasses checking .gitattributes numcopies.
--[[Joey]]
> Note that the assistant and git-annex sync already check numcopies
> for all known associated files, so already handled this for unlocked
> files. With the recent change to also track
> associated files for locked files, they also handle it for those.
>
> But, git-annex drop/move/import don't yet.