allow force overriding the disk space check
This commit is contained in:
parent
e096c8278a
commit
68d90b3328
1 changed files with 7 additions and 3 deletions
10
Content.hs
10
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 ()
|
||||
|
|
Loading…
Reference in a new issue