Skip to content

Commit 3be7efc

Browse files
garimasi514gitster
authored andcommitted
commit-graph: define and use MAX_NUM_CHUNKS
This is a minor cleanup to make it easier to change the number of chunks being written to the commit graph. Reviewed-by: Jakub Narębski <[email protected]> Signed-off-by: Garima Singh <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9fadedd commit 3be7efc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

commit-graph.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#define GRAPH_CHUNKID_DATA 0x43444154 /* "CDAT" */
2424
#define GRAPH_CHUNKID_EXTRAEDGES 0x45444745 /* "EDGE" */
2525
#define GRAPH_CHUNKID_BASE 0x42415345 /* "BASE" */
26+
#define MAX_NUM_CHUNKS 5
2627

2728
#define GRAPH_DATA_WIDTH (the_hash_algo->rawsz + 16)
2829

@@ -1350,8 +1351,8 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
13501351
int fd;
13511352
struct hashfile *f;
13521353
struct lock_file lk = LOCK_INIT;
1353-
uint32_t chunk_ids[6];
1354-
uint64_t chunk_offsets[6];
1354+
uint32_t chunk_ids[MAX_NUM_CHUNKS + 1];
1355+
uint64_t chunk_offsets[MAX_NUM_CHUNKS + 1];
13551356
const unsigned hashsz = the_hash_algo->rawsz;
13561357
struct strbuf progress_title = STRBUF_INIT;
13571358
int num_chunks = 3;

0 commit comments

Comments
 (0)