diff options
Diffstat (limited to 'Annex/Journal.hs')
-rw-r--r-- | Annex/Journal.hs | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Annex/Journal.hs b/Annex/Journal.hs index 198388aa8..4d9c6ab66 100644 --- a/Annex/Journal.hs +++ b/Annex/Journal.hs @@ -87,17 +87,11 @@ withJournalHandle a = do {- Checks if there are changes in the journal. -} journalDirty :: Annex Bool -journalDirty = withJournalHandle go - where - go h = do - v <- readDirectory h - case v of - (Just f) - | not (dirCruft f) -> do - closeDirectory h - return True - | otherwise -> go h - Nothing -> return False +journalDirty = do + d <- fromRepo gitAnnexJournalDir + liftIO $ + (not <$> isDirectoryEmpty d) + `catchIO` (const $ doesDirectoryExist d) {- Produces a filename to use in the journal for a file on the branch. - |