fsck: Now works in bare repositories.
Checks location log information, and file contents. Does not check that numcopies is satisfied, as .gitattributes information about numcopies is not available in a bare repository. In practice, that should not be a problem, since fsck is also run in a checkout and will check numcopies there.
This commit is contained in:
parent
fef2cf7398
commit
2566eb85fe
7 changed files with 77 additions and 31 deletions
|
@ -67,19 +67,11 @@ checkRemoteUnused name = do
|
|||
checkRemoteUnused' :: Remote.Remote Annex -> Annex ()
|
||||
checkRemoteUnused' r = do
|
||||
showAction "checking for unused data"
|
||||
remotehas <- filterM isthere =<< loggedKeys
|
||||
remotehas <- loggedKeysFor (Remote.uuid r)
|
||||
remoteunused <- excludeReferenced remotehas
|
||||
let list = number 0 remoteunused
|
||||
writeUnusedFile "" list
|
||||
unless (null remoteunused) $ showLongNote $ remoteUnusedMsg r list
|
||||
where
|
||||
{- This should run strictly to avoid the filterM
|
||||
- building many thunks containing keyLocations data. -}
|
||||
isthere k = do
|
||||
us <- keyLocations k
|
||||
let !there = uuid `elem` us
|
||||
return there
|
||||
uuid = Remote.uuid r
|
||||
|
||||
writeUnusedFile :: FilePath -> [(Int, Key)] -> Annex ()
|
||||
writeUnusedFile prefix l = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue