diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2019-06-18 11:14:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-19 20:46:26 -0700 |
commit | 118bd570029f5610abdbf1a220e87d3a5c241f5f (patch) | |
tree | efebe66ef31726d2eb9c8b18ccf295510beb47c8 /commit-graph.h | |
parent | 5c84b3396c73382eb49285b4e4bbb1bf82be3a9c (diff) | |
download | git-118bd570029f5610abdbf1a220e87d3a5c241f5f.tar.gz |
commit-graph: add base graphs chunk
To quickly verify a commit-graph chain is valid on load, we will
read from the new "Base Graphs Chunk" of each file in the chain.
This will prevent accidentally loading incorrect data from manually
editing the commit-graph-chain file or renaming graph-{hash}.graph
files.
The commit_graph struct already had an object_id struct "oid", but
it was never initialized or used. Add a line to read the hash from
the end of the commit-graph file and into the oid member.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.h')
-rw-r--r-- | commit-graph.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/commit-graph.h b/commit-graph.h index 5819910a5b..6e7d42cf32 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -55,6 +55,7 @@ struct commit_graph { const unsigned char *chunk_oid_lookup; const unsigned char *chunk_commit_data; const unsigned char *chunk_extra_edges; + const unsigned char *chunk_base_graphs; }; struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st); |