Skip to content

Commit a37ed89

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 aa25c82 commit a37ed89

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
@@ -361,10 +361,10 @@ int generation_numbers_enabled(struct repository *r)
361361
return !!first_generation;
362362
}
363363

364-
void close_commit_graph(struct repository *r)
364+
void close_commit_graph(struct raw_object_store *o)
365365
{
366-
free_commit_graph(r->objects->commit_graph);
367-
r->objects->commit_graph = NULL;
366+
free_commit_graph(o->commit_graph);
367+
o->commit_graph = NULL;
368368
}
369369

370370
static int bsearch_graph(struct commit_graph *g, struct object_id *oid, uint32_t *pos)
@@ -1110,7 +1110,7 @@ void write_commit_graph(const char *obj_dir,
11101110
stop_progress(&progress);
11111111
strbuf_release(&progress_title);
11121112

1113-
close_commit_graph(the_repository);
1113+
close_commit_graph(the_repository->objects);
11141114
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
11151115
commit_lock_file(&lk);
11161116

commit-graph.h

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

7575
int verify_commit_graph(struct repository *r, struct commit_graph *g);
7676

77-
void close_commit_graph(struct repository *);
77+
void close_commit_graph(struct raw_object_store *);
7878
void free_commit_graph(struct commit_graph *);
7979

8080
#endif

upload-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ static void deepen_by_rev_list(struct packet_writer *writer, int ac,
722722
{
723723
struct commit_list *result;
724724

725-
close_commit_graph(the_repository);
725+
close_commit_graph(the_repository->objects);
726726
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
727727
send_shallow(writer, result);
728728
free_commit_list(result);

0 commit comments

Comments
 (0)