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>
This commit is contained in:
Derrick Stolee 2019-05-17 14:26:23 -04:00 коммит произвёл Johannes Schindelin
Родитель 0fc7a44145
Коммит 7bcb7cd4d6
3 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -361,10 +361,10 @@ int generation_numbers_enabled(struct repository *r)
return !!first_generation;
}
void close_commit_graph(struct repository *r)
void close_commit_graph(struct raw_object_store *o)
{
free_commit_graph(r->objects->commit_graph);
r->objects->commit_graph = NULL;
free_commit_graph(o->commit_graph);
o->commit_graph = NULL;
}
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,
stop_progress(&progress);
strbuf_release(&progress_title);
close_commit_graph(the_repository);
close_commit_graph(the_repository->objects);
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
commit_lock_file(&lk);

Просмотреть файл

@ -74,7 +74,7 @@ void write_commit_graph(const char *obj_dir,
int verify_commit_graph(struct repository *r, struct commit_graph *g);
void close_commit_graph(struct repository *);
void close_commit_graph(struct raw_object_store *);
void free_commit_graph(struct commit_graph *);
#endif

Просмотреть файл

@ -722,7 +722,7 @@ static void deepen_by_rev_list(struct packet_writer *writer, int ac,
{
struct commit_list *result;
close_commit_graph(the_repository);
close_commit_graph(the_repository->objects);
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
send_shallow(writer, result);
free_commit_list(result);