diff options
author | SZEDER Gábor <szeder.dev@gmail.com> | 2020-07-01 13:27:27 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-07-01 14:17:43 -0700 |
commit | 2dd4fed92715fddcefc0223b79e51af2798e921e (patch) | |
tree | f0a963d3f5b31946152474be8420c24a696f3af9 /LGPL-2.1 | |
parent | commit-graph: simplify chunk writes into loop (diff) | |
download | tgif-2dd4fed92715fddcefc0223b79e51af2798e921e.tar.xz |
commit-graph: check chunk sizes after writing
In my experience while experimenting with new commit-graph chunks,
early versions of the corresponding new write_commit_graph_my_chunk()
functions are, sadly but not surprisingly, often buggy, and write more
or less data than they are supposed to, especially if the chunk size
is not directly proportional to the number of commits. This then
causes all kinds of issues when reading such a bogus commit-graph
file, raising the question of whether the writing or the reading part
happens to be buggy this time.
Let's catch such issues early, already when writing the commit-graph
file, and check that each write_graph_chunk_*() function wrote the
amount of data that it was expected to, and what has been encoded in
the Chunk Lookup table. Now that all commit-graph chunks are written
in a loop we can do this check in a single place for all chunks, and
any chunks added in the future will get checked as well.
Helped-by: René Scharfe <l.s.r@web.de>
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'LGPL-2.1')
0 files changed, 0 insertions, 0 deletions