summaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-16 21:18:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-16 21:18:34 -0400
commita8816efc140108cc62713cc6227db69ef96cd913 (patch)
treedc65eb50fa2765fc819ef54e900974dc530204a8 /Command/Unused.hs
parent8d4d84b80f8d652a28baa12a51bf5e24681aada4 (diff)
status: New subcommand to show info about an annex, including its size.
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index a2e1c86de..1482f057e 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -144,16 +144,16 @@ unusedKeys = do
if fast
then do
showNote "fast mode enabled; only finding stale files"
- tmp <- staleKeys' gitAnnexTmpDir
- bad <- staleKeys' gitAnnexBadDir
+ tmp <- staleKeys gitAnnexTmpDir
+ bad <- staleKeys gitAnnexBadDir
return ([], bad, tmp)
else do
showNote "checking for unused data..."
present <- getKeysPresent
referenced <- getKeysReferenced
let unused = present `exclude` referenced
- staletmp <- staleKeys gitAnnexTmpDir present
- stalebad <- staleKeys gitAnnexBadDir present
+ staletmp <- staleKeysPrune gitAnnexTmpDir present
+ stalebad <- staleKeysPrune gitAnnexBadDir present
return (unused, stalebad, staletmp)
{- Finds items in the first, smaller list, that are not
@@ -182,9 +182,9 @@ getKeysReferenced = do
- When a list of presently available keys is provided, stale keys
- that no longer have value are deleted.
-}
-staleKeys :: (Git.Repo -> FilePath) -> [Key] -> Annex [Key]
-staleKeys dirspec present = do
- contents <- staleKeys' dirspec
+staleKeysPrune :: (Git.Repo -> FilePath) -> [Key] -> Annex [Key]
+staleKeysPrune dirspec present = do
+ contents <- staleKeys dirspec
let stale = contents `exclude` present
let dup = contents `exclude` stale
@@ -195,8 +195,8 @@ staleKeys dirspec present = do
return stale
-staleKeys' :: (Git.Repo -> FilePath) -> Annex [Key]
-staleKeys' dirspec = do
+staleKeys :: (Git.Repo -> FilePath) -> Annex [Key]
+staleKeys dirspec = do
g <- Annex.gitRepo
let dir = dirspec g
exists <- liftIO $ doesDirectoryExist dir