rewrite loggedkeys to use git-annex branch

That sucking sound is a whole page of code vanishing to be replaced with
  return . catMaybes . map (logFileKey . takeFileName) =<< Branch.files
What can I say, git is my database, and haskell my copilot.
This commit is contained in:
Joey Hess 2011-06-22 23:24:14 -04:00
parent 68783fd5e0
commit aad73c5721
3 changed files with 12 additions and 22 deletions

View file

@ -66,10 +66,8 @@ checkRemoteUnused name = do
checkRemoteUnused' :: Remote.Remote Annex -> Annex ()
checkRemoteUnused' r = do
showNote $ "checking for unused data..."
g <- Annex.gitRepo
referenced <- getKeysReferenced
logged <- loggedKeys g
remotehas <- filterM isthere logged
remotehas <- filterM isthere =<< loggedKeys
let remoteunused = remotehas `exclude` referenced
let list = number 0 remoteunused
writeUnusedFile "" list