]> git.scottworley.com Git - annex-ec/commitdiff
Don't unnecessarily round-up already-round numbers master
authorScott Worley <scottworley@scottworley.com>
Tue, 21 Apr 2026 05:32:28 +0000 (22:32 -0700)
committerScott Worley <scottworley@scottworley.com>
Tue, 21 Apr 2026 05:32:28 +0000 (22:32 -0700)
annex-ec

index 660291936563690b10e82123ccf7c78371b65c1f..81ba8bbc1c4485b36044ab58d9b0b9c37b7207f0 100755 (executable)
--- a/annex-ec
+++ b/annex-ec
@@ -77,7 +77,7 @@ git annex get -- "$@"
 
 max_size=$(find -L "$@" -printf '%s\n' | sort -nr | head -n1)
 while true;do
-  block_size=$(( ((max_size/(block_size_is_a_multiple_of*blocks_per_file))+1) * block_size_is_a_multiple_of))
+  block_size=$(( (((max_size-1)/(block_size_is_a_multiple_of*blocks_per_file))+1) * block_size_is_a_multiple_of))
   if (( block_size < max_block_size ));then break;fi
   blocks_per_file=$((blocks_per_file + 1))
 done