summaryrefslogtreecommitdiff
path: root/Command/Unused.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Unused.hs')
-rw-r--r--Command/Unused.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index b878ab265..246929f71 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -299,11 +299,11 @@ staleKeysPrune dirspec = do
staleKeys :: (Git.Repo -> FilePath) -> Annex [Key]
staleKeys dirspec = do
dir <- fromRepo dirspec
- exists <- liftIO $ doesDirectoryExist dir
- if not exists
- then return []
- else do
+ ifM (liftIO $ doesDirectoryExist dir)
+ ( do
contents <- liftIO $ getDirectoryContents dir
files <- liftIO $ filterM doesFileExist $
map (dir </>) contents
return $ mapMaybe (fileKey . takeFileName) files
+ , return []
+ )