stats: fixed wrong size reporting for repos from compound shards (#352)
The boundaries slice keeps the offsets at which text contents of files start within a shard,
one entry per file and one sentinel entry in the end. Therefore, for simple shards the last
entry in this slice can be used to determine the total size of the files in the shard.
The accurate calculation (boundaries[len(boundaries) - 1] - boundaries[0]) is simplified
by the relativeIndex() trick, so boundaries[0] equals 0, and the expression we were using to
calculate the file size was boundaries[len(boundaries) - 1].
Later we added support for compound shards where different files in a shard can belong to
different repos, although files from a single repo always occupy a contiguous subrange in
all data structures where direct indexing by file number makes sense. If the files span the
subrange of indexes [l, r) the correct expression for their total size is boundaries[r] - boundaries[l].
However, the old code had a mistake where we used, by analogy with the simple shard case,
the one-term expression boundaries[r]. This resulted in overestimation of the total repo sizes for
repos that ended up in compound shards.