diff options
Diffstat (limited to 'Command/DropUnused.hs')
-rw-r--r-- | Command/DropUnused.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs index 55007c1f7..a01e08ab5 100644 --- a/Command/DropUnused.hs +++ b/Command/DropUnused.hs @@ -49,7 +49,7 @@ start (unused, unusedbad, unusedtmp) s = notBareRepo $ search ] where search [] = stop - search ((m, a):rest) = do + search ((m, a):rest) = case M.lookup s m of Nothing -> search rest Just key -> do @@ -78,10 +78,9 @@ readUnusedLog prefix = do let f = gitAnnexUnusedLog prefix g e <- liftIO $ doesFileExist f if e - then do - l <- liftIO $ readFile f - return $ M.fromList $ map parse $ lines l - else return $ M.empty + then return . M.fromList . map parse . lines + =<< liftIO (readFile f) + else return M.empty where parse line = (head ws, fromJust $ readKey $ unwords $ tail ws) where |