#define GRAPH_VERSION_1 0x1
#define GRAPH_VERSION GRAPH_VERSION_1
- #define GRAPH_OID_VERSION_SHA1 1
- #define GRAPH_OID_LEN_SHA1 GIT_SHA1_RAWSZ
- #define GRAPH_OID_VERSION GRAPH_OID_VERSION_SHA1
- #define GRAPH_OID_LEN GRAPH_OID_LEN_SHA1
-
#define GRAPH_OCTOPUS_EDGES_NEEDED 0x80000000
-#define GRAPH_PARENT_MISSING 0x7fffffff
#define GRAPH_EDGE_LAST_MASK 0x7fffffff
#define GRAPH_PARENT_NONE 0x70000000
int num_chunks;
int num_extra_edges;
struct commit_list *parent;
+ struct progress *progress = NULL;
+ const unsigned hashsz = the_hash_algo->rawsz;
+ if (!commit_graph_compatible(the_repository))
+ return;
+
oids.nr = 0;
- oids.alloc = approximate_object_count() / 4;
+ oids.alloc = approximate_object_count() / 32;
+ oids.progress = NULL;
+ oids.progress_done = 0;
if (append) {
prepare_commit_graph_one(the_repository, obj_dir);
}
write_graph_chunk_fanout(f, commits.list, commits.nr);
- write_graph_chunk_oids(f, GRAPH_OID_LEN, commits.list, commits.nr);
- write_graph_chunk_data(f, GRAPH_OID_LEN, commits.list, commits.nr);
+ write_graph_chunk_oids(f, hashsz, commits.list, commits.nr);
+ write_graph_chunk_data(f, hashsz, commits.list, commits.nr);
write_graph_chunk_large_edges(f, commits.list, commits.nr);
- close_commit_graph();
+ close_commit_graph(the_repository);
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
commit_lock_file(&lk);