Take space that will be used by running downloads into account when checking annex.diskreserve.

This commit is contained in:
Joey Hess 2015-05-12 15:19:08 -04:00
parent 5935578ed2
commit a812d598ef
6 changed files with 55 additions and 13 deletions

View file

@ -135,7 +135,7 @@ performRemote key file backend numcopies remote =
let cleanup = liftIO $ catchIO (removeFile tmp) (const noop)
cleanup
cleanup `after` a tmp
getfile tmp = ifM (checkDiskSpace (Just tmp) key 0)
getfile tmp = ifM (checkDiskSpace (Just tmp) key 0 True)
( ifM (Remote.retrieveKeyFileCheap remote key (Just file) tmp)
( return (Just True)
, ifM (Annex.getState Annex.fast)