fsck: Avoid complaining about required content of dead repositories
requiredContentMap does not exclude dead repos. Usually this is not a problem because it is used when we are operating on a repository, and in that case, the repository is not dead (or if it is, the required content configurations should still be used). But in the case of fsck, this made a old required content config for a dead repository be warned about in a situation where it is not a problem.
This commit is contained in:
parent
c45c4fd897
commit
cc8f7e9776
3 changed files with 8 additions and 3 deletions
|
@ -4,6 +4,7 @@ git-annex (10.20250321) UNRELEASED; urgency=medium
|
||||||
configured as annex-cluster-node, warn and avoid writing bad data to
|
configured as annex-cluster-node, warn and avoid writing bad data to
|
||||||
the git-annex branch.
|
the git-annex branch.
|
||||||
* Fix build without the assistant.
|
* Fix build without the assistant.
|
||||||
|
* fsck: Avoid complaining about required content of dead repositories.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Fri, 21 Mar 2025 12:27:11 -0400
|
-- Joey Hess <id@joeyh.name> Fri, 21 Mar 2025 12:27:11 -0400
|
||||||
|
|
||||||
|
|
|
@ -375,11 +375,13 @@ verifyRequiredContent key ai@(ActionItemAssociatedFile afile _) = case afile of
|
||||||
-- Can't be checked if there's no associated file.
|
-- Can't be checked if there's no associated file.
|
||||||
AssociatedFile Nothing -> return True
|
AssociatedFile Nothing -> return True
|
||||||
AssociatedFile (Just _) -> do
|
AssociatedFile (Just _) -> do
|
||||||
requiredlocs <- S.fromList . M.keys <$> requiredContentMap
|
requiredlocs <- filterM notdead =<< (M.keys <$> requiredContentMap)
|
||||||
if S.null requiredlocs
|
if null requiredlocs
|
||||||
then return True
|
then return True
|
||||||
else go requiredlocs
|
else go (S.fromList requiredlocs)
|
||||||
where
|
where
|
||||||
|
notdead u = (/=) DeadTrusted <$> lookupTrust u
|
||||||
|
|
||||||
go requiredlocs = do
|
go requiredlocs = do
|
||||||
presentlocs <- S.fromList <$> loggedLocations key
|
presentlocs <- S.fromList <$> loggedLocations key
|
||||||
missinglocs <- filterM
|
missinglocs <- filterM
|
||||||
|
|
|
@ -37,3 +37,5 @@ local repository version: 10
|
||||||
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
||||||
|
|
||||||
Best invention since sliced bread.
|
Best invention since sliced bread.
|
||||||
|
|
||||||
|
> Good catch! [[fixed|done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue