Skip to content

Commit 46cecd9

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 <dstolee@microsoft.com>
1 parent ab15ad1 commit 46cecd9

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)
@@ -1108,7 +1108,7 @@ void write_commit_graph(const char *obj_dir,
11081108
stop_progress(&progress);
11091109
strbuf_release(&progress_title);
11101110

1111-
close_commit_graph(the_repository);
1111+
close_commit_graph(the_repository->objects);
11121112
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
11131113
commit_lock_file(&lk);
11141114

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)