commit-graph: use raw_object_store when closing
The close_commit_graph() method took a repository struct, but then only uses the raw_object_store within. Change the function prototype to make the method more flexible. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Derrick Stolee committed
May 17, 2019 at 11:41 UTC
c3a3a964b29221a9b5fa305a08037c90b9f74be0
3 files changed
+6
-6
commit-graph.c
+4
-4
@@ -359,10 +359,10 @@ int generation_numbers_enabled(struct repository *r)
359
return !!first_generation;
360
}
361
362
-void close_commit_graph(struct repository *r)
362
+void close_commit_graph(struct raw_object_store *o)
363
{
364
- free_commit_graph(r->objects->commit_graph);
365
- r->objects->commit_graph = NULL;
364
+ free_commit_graph(o->commit_graph);
365
+ o->commit_graph = NULL;
366
}
367
368
static int bsearch_graph(struct commit_graph *g, struct object_id *oid, uint32_t *pos)
@@ -1086,7 +1086,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
1086
stop_progress(&ctx->progress);
1087
strbuf_release(&progress_title);
1088
1089
- close_commit_graph(ctx->r);
1089
+ close_commit_graph(ctx->r->objects);
1090
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
1091
commit_lock_file(&lk);
1092
commit-graph.h
+1
-1
@@ -82,7 +82,7 @@ int write_commit_graph(const char *obj_dir,
82
83
int verify_commit_graph(struct repository *r, struct commit_graph *g);
84
85
-void close_commit_graph(struct repository *);
85
+void close_commit_graph(struct raw_object_store *);
86
void free_commit_graph(struct commit_graph *);
87
88
#endif
upload-pack.c
+1
-1
@@ -717,7 +717,7 @@ static void deepen_by_rev_list(struct packet_writer *writer, int ac,
717
{
718
struct commit_list *result;
719
720
- close_commit_graph(the_repository);
720
+ close_commit_graph(the_repository->objects);
721
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
722
send_shallow(writer, result);
723
free_commit_list(result);