Skip to content

Commit ee410f6

Browse files
derrickstoleedscho
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]>
1 parent 8104ec9 commit ee410f6

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
@@ -305,10 +305,10 @@ int generation_numbers_enabled(struct repository *r)
305305
return !!first_generation;
306306
}
307307

308-
void close_commit_graph(struct repository *r)
308+
void close_commit_graph(struct raw_object_store *o)
309309
{
310-
free_commit_graph(r->objects->commit_graph);
311-
r->objects->commit_graph = NULL;
310+
free_commit_graph(o->commit_graph);
311+
o->commit_graph = NULL;
312312
}
313313

314314
static int bsearch_graph(struct commit_graph *g, struct object_id *oid, uint32_t *pos)
@@ -1049,7 +1049,7 @@ void write_commit_graph(const char *obj_dir,
10491049
stop_progress(&progress);
10501050
strbuf_release(&progress_title);
10511051

1052-
close_commit_graph(the_repository);
1052+
close_commit_graph(the_repository->objects);
10531053
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
10541054
commit_lock_file(&lk);
10551055

commit-graph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void write_commit_graph(const char *obj_dir,
7272

7373
int verify_commit_graph(struct repository *r, struct commit_graph *g);
7474

75-
void close_commit_graph(struct repository *);
75+
void close_commit_graph(struct raw_object_store *);
7676
void free_commit_graph(struct commit_graph *);
7777

7878
#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)