summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-18 14:23:34 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-18 14:23:42 -0400
commit2781e270c7f388d4d0e252240b84b4a299d040fd (patch)
tree922ce19eded16c736ff1248862f3cec9dba70349
parent5f62e03e618b20a32e3a927be2bdf71dd525d5ae (diff)
fsck --from remote: Avoid downloading a key if it would go over the annex.diskreserve limit.
-rw-r--r--Command/Fsck.hs6
-rw-r--r--debian/changelog2
2 files changed, 6 insertions, 2 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index 74cff7491..39dba08dd 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -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
diff --git a/debian/changelog b/debian/changelog
index 00aed03a0..2acdfac96 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,8 @@ git-annex (5.20150410) UNRELEASED; urgency=medium
* fsck --from remote: When bad content is found in the remote,
and the local repo does not have a copy of the content, preserve
the bad content in .git/annex/bad/ to avoid further data loss.
+ * fsck --from remote: Avoid downloading a key if it would go over
+ the annex.diskreserve limit.
-- Joey Hess <id@joeyh.name> Thu, 09 Apr 2015 20:59:43 -0400