summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Content.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Content.hs b/Content.hs
index bc43e4b44..633d827e6 100644
--- a/Content.hs
+++ b/Content.hs
@@ -129,13 +129,17 @@ checkDiskSpace' adjustment key = do
(_, Nothing) -> return ()
(Just (FileSystemStats { fsStatBytesAvailable = have }), Just need) ->
if (need + reserve > have + adjustment)
- then error $ "not enough free space, need " ++
- roughSize True (need + reserve - have - adjustment) ++
- " more"
+ then needmorespace (need + reserve - have - adjustment)
else return ()
where
megabyte :: Integer
megabyte = 1024 * 1024
+ needmorespace n = do
+ force <- Annex.getState Annex.force
+ unless force $
+ error $ "not enough free space, need " ++
+ roughSize True n ++
+ " more (use --force to override this check or adjust annex.diskreserve)"
{- Removes the write bits from a file. -}
preventWrite :: FilePath -> IO ()