summaryrefslogtreecommitdiff
path: root/Command/Status.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-13 13:30:24 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-13 13:30:24 -0400
commit4a7520003c4917cfcb12cde679b51dd924ba8c79 (patch)
tree0879e7523245a125574baaf2b39f37e7e66c0111 /Command/Status.hs
parentef6f41df4fe8919d8bb42ffb0f7af18fa2aecce3 (diff)
status: Fix a crash if a temp file went away while its size was being checked for status.
Diffstat (limited to 'Command/Status.hs')
-rw-r--r--Command/Status.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Command/Status.hs b/Command/Status.hs
index 89d08c794..e1ace0052 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 ++ ")"