From 68518a9b3d40e7faea6d58d3e8cdf5e1635be0ae Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 13 Oct 2013 13:30:24 -0400 Subject: [PATCH] status: Fix a crash if a temp file went away while its size was being checked for status. --- Command/Status.hs | 7 ++++--- debian/changelog | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Command/Status.hs b/Command/Status.hs index 89d08c7947..e1ace00522 100644 --- a/Command/Status.hs +++ b/Command/Status.hs @@ -371,10 +371,11 @@ staleSize label dirspec = go =<< lift (Command.Unused.staleKeys dirspec) onsize size = stat label $ json (++ aside "clean up with git-annex unused") $ return $ roughSize storageUnits False size - keysizes keys = map (fromIntegral . fileSize) <$> stats keys - stats keys = do + keysizes keys = do dir <- lift $ fromRepo dirspec - liftIO $ forM keys $ \k -> getFileStatus (dir keyFile k) + liftIO $ forM keys $ \k -> catchDefaultIO 0 $ + fromIntegral . fileSize + <$> getFileStatus (dir keyFile k) aside :: String -> String aside s = " (" ++ s ++ ")" diff --git a/debian/changelog b/debian/changelog index 853f9a8547..d558b83ae5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,8 @@ git-annex (4.20131003) UNRELEASED; urgency=low * Remove bogus runshell loop check. * addurl: Improve message when adding url with wrong size to existing file. * Fixed handling of URL keys that have no recorded size. + * status: Fix a crash if a temp file went away while its size was + being checked for status. -- Joey Hess Thu, 03 Oct 2013 15:41:24 -0400