diff options
author | Joey Hess <joey@kitenet.net> | 2014-08-01 17:16:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-08-01 17:16:20 -0400 |
commit | 70c55d3b42bb4650faf8626726bf17b65f16b57a (patch) | |
tree | 6cf7290da1c6f1f2996ae2f591c4ad0d35f02431 /Remote/Helper | |
parent | 79eb6b4d04aa00350b60c6f1ae87c1826baa8e9a (diff) |
testremote: Test retrieveKeyFile resume
And fixed a bug found by these tests; retrieveKeyFile would fail
when the dest file was already complete.
This commit was sponsored by Bradley Unterrheiner.
Diffstat (limited to 'Remote/Helper')
-rw-r--r-- | Remote/Helper/Chunked.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Remote/Helper/Chunked.hs b/Remote/Helper/Chunked.hs index 9482153d1..2a156ddc5 100644 --- a/Remote/Helper/Chunked.hs +++ b/Remote/Helper/Chunked.hs @@ -241,7 +241,9 @@ retrieveChunks retriever u chunkconfig encryptor basek dest basep sink currsize <- liftIO $ catchMaybeIO $ toInteger . fileSize <$> getFileStatus dest let ls' = maybe ls (setupResume ls) currsize - firstavail currsize ls' `catchNonAsyncAnnex` giveup + if any (== 0) (map length ls') + then return True -- dest is already complete + else firstavail currsize ls' `catchNonAsyncAnnex` giveup giveup e = do warning (show e) |