diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-07-13 02:10:28 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-16 02:51:38 +0300 |
commit | 2dd804cd12143741ea4188346fba250e821609b5 (patch) | |
tree | 97f0c0b70cbe5a08b4d0d56e7daf9b83fe201b44 /commit-graph.h | |
parent | 6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e (diff) |
t5318: demonstrate commit-graph generation v2 corruption
When upgrading a commit-graph using generation v1 to one using
generation v2, it is possible to force Git into a corrupt state where it
(incorrectly) believes that a GDO2 chunk is necessary, *after* deciding
not to write one.
This makes subsequent reads using the commit-graph produce the following
error message:
fatal: commit-graph requires overflow generation data but has none
Demonstrate this bug by increasing our test coverage to include a
minimal example of upgrading a commit-graph from generation v1 to v2.
The only notable components of this test are:
- The committer date of the commit is chosen carefully so that the
offset underflows when computed using a v1 generation number, but
would not overflow when using v2 generation numbers.
- The upgrade to generation number v2 must read in the v1 generation
numbers, which we can do by passing `--changed-paths`, which will
force the commit-graph internals to call `fill_commit_graph_info()`.
A future patch will squash this bug.
Reported-by: Jeff King <peff@peff.net>
Reproduced-by: Will Chandler <wfc@wfchandler.org>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.h')
0 files changed, 0 insertions, 0 deletions