Skip to content

Commit c3a3a96

Browse files
derrickstoleegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 238def5 commit c3a3a96

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

commit-graph.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ int generation_numbers_enabled(struct repository *r)
359359
return !!first_generation;
360360
}
361361

362-
void close_commit_graph(struct repository *r)
362+
void close_commit_graph(struct raw_object_store *o)
363363
{
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;
366366
}
367367

368368
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)
10861086
stop_progress(&ctx->progress);
10871087
strbuf_release(&progress_title);
10881088

1089-
close_commit_graph(ctx->r);
1089+
close_commit_graph(ctx->r->objects);
10901090
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
10911091
commit_lock_file(&lk);
10921092

commit-graph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ int write_commit_graph(const char *obj_dir,
8282

8383
int verify_commit_graph(struct repository *r, struct commit_graph *g);
8484

85-
void close_commit_graph(struct repository *);
85+
void close_commit_graph(struct raw_object_store *);
8686
void free_commit_graph(struct commit_graph *);
8787

8888
#endif

upload-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ static void deepen_by_rev_list(struct packet_writer *writer, int ac,
717717
{
718718
struct commit_list *result;
719719

720-
close_commit_graph(the_repository);
720+
close_commit_graph(the_repository->objects);
721721
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
722722
send_shallow(writer, result);
723723
free_commit_list(result);

0 commit comments

Comments
 (0)