added ifM and nuked 11 lines of code
no behavior changes
This commit is contained in:
parent
a4f72c9625
commit
60ab3d84e1
17 changed files with 151 additions and 162 deletions
|
@ -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 []
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue