fix reversion on skipping dead keys in --all/bare

Fix a reversion that made dead keys not be skipped when operating on all
keys via --all or in a bare repo. (Introduced in version 8.20200720)

Also, improved the documentation of git-annex-dead, it does not only apply
to fsck --all.

Also, made git-annex fsck, when run on a file whose key is dead, display
that. Before, it displayed that only when run with --all, but with this
fix, it skips dead keys with --all. But it can still be run on a file that
uses a dead key, and displaying "This key is dead" explains to the user
why it does not consider missing content for it to be a problem.

Sponsored-by: k0ld on Patreon
This commit is contained in:
Joey Hess 2022-09-13 14:38:13 -04:00
parent b7f13181ad
commit eefc026370
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 24 additions and 4 deletions

View file

@ -574,7 +574,7 @@ checkKeyNumCopies key afile numcopies = do
(deadlocations, safelocations) <- trustPartition DeadTrusted otherlocations
let present = length safelocations
if present < fromNumCopies numcopies
then ifM (pure (not hasafile) <&&> checkDead key)
then ifM (checkDead key)
( do
showLongNote $ "This key is dead, skipping."
return True