fsck --from remote: Avoid downloading a key if it would go over the annex.diskreserve limit.

This commit is contained in:
Joey Hess 2015-04-18 14:23:34 -04:00
parent 8489057e8d
commit 8d685768d3
2 changed files with 6 additions and 2 deletions

View file

@ -135,14 +135,16 @@ performRemote key file backend numcopies remote =
let cleanup = liftIO $ catchIO (removeFile tmp) (const noop)
cleanup
cleanup `after` a tmp
getfile tmp =
ifM (Remote.retrieveKeyFileCheap remote key tmp)
getfile tmp = ifM (checkDiskSpace (Just tmp) key 0)
( ifM (Remote.retrieveKeyFileCheap remote key tmp)
( return True
, ifM (Annex.getState Annex.fast)
( return False
, Remote.retrieveKeyFile remote key Nothing tmp dummymeter
)
)
, return False
)
dummymeter _ = noop
startKey :: Incremental -> Key -> NumCopies -> CommandStart