fix to use 1 chunk for empty file
Fix retrival of an empty file that is stored in a special remote with chunking enabled. The speculative chunk stuff caused a reversion by adding an empty list for the empty file. Which is just wrong; the empty file is still stored on the remote, and should be retrieved like any other file. It uses 1 chunk, so `max 1` is the simple fix. Sponsored-by: Noam Kremen on Patreon
This commit is contained in:
parent
f30532614f
commit
13fc6a9b6a
4 changed files with 23 additions and 1 deletions
|
@ -554,7 +554,7 @@ chunkKeys' onlychunks u chunkconfig k = do
|
|||
Nothing -> l
|
||||
Just keysz ->
|
||||
let (d, m) = keysz `divMod` fromIntegral chunksz
|
||||
chunkcount = d + if m == 0 then 0 else 1
|
||||
chunkcount = max 1 (d + if m == 0 then 0 else 1)
|
||||
v = (FixedSizeChunks chunksz, chunkcount)
|
||||
in if v `elem` recorded
|
||||
then l
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue