3 #include "commit-graph.h"
4 #include "repository.h"
5 #include "object-store.h"
7 int cmd__read_graph(int argc
, const char **argv
)
9 struct commit_graph
*graph
= NULL
;
10 struct object_directory
*odb
;
12 setup_git_directory();
13 odb
= the_repository
->objects
->odb
;
15 graph
= read_commit_graph_one(the_repository
, odb
);
20 printf("header: %08x %d %d %d %d\n",
21 ntohl(*(uint32_t*)graph
->data
),
22 *(unsigned char*)(graph
->data
+ 4),
23 *(unsigned char*)(graph
->data
+ 5),
24 *(unsigned char*)(graph
->data
+ 6),
25 *(unsigned char*)(graph
->data
+ 7));
26 printf("num_commits: %u\n", graph
->num_commits
);
29 if (graph
->chunk_oid_fanout
)
30 printf(" oid_fanout");
31 if (graph
->chunk_oid_lookup
)
32 printf(" oid_lookup");
33 if (graph
->chunk_commit_data
)
34 printf(" commit_metadata");
35 if (graph
->chunk_extra_edges
)
36 printf(" extra_edges");
37 if (graph
->chunk_bloom_indexes
)
38 printf(" bloom_indexes");
39 if (graph
->chunk_bloom_data
)
40 printf(" bloom_data");