summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-10 00:16:53 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-10 00:16:53 -0400
commit200b8d462e46db7b6bb87ab832529199fff58247 (patch)
tree156302f2b35e085f9bf88a2ab1a9cbf70f9772ca /Annex
parente3c1ea0c526d74dd1636be4488437c9845fb4fad (diff)
refactor
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Journal.hs16
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.
-