commit-graph: use raw_object_store when closing
authorDerrick Stolee <dstolee@microsoft.com>
Fri, 17 May 2019 18:41:47 +0000 (11:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Jun 2019 18:33:54 +0000 (11:33 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c
commit-graph.h
upload-pack.c
index 9d2c72f5b4ac0c08e62f2ec6d2760737478c9d0c..76d189de45416165fea039e7be67375b30e7a230 100644 (file)
@@ -359,10 +359,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)
@@ -1086,7 +1086,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
        stop_progress(&ctx->progress);
        strbuf_release(&progress_title);
 
-       close_commit_graph(ctx->r);
+       close_commit_graph(ctx->r->objects);
        finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
        commit_lock_file(&lk);
 
index 01538b5cf59986ada4e8fa69552ed8ba8f33112e..390c7f696104fbe772151b91cb04889d0f682401 100644 (file)
@@ -82,7 +82,7 @@ int 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
index d098ef598289d16956309cb73d4518a92c1206af..b51bed21e4059b63d304fdd34f9777bb6810adf7 100644 (file)
@@ -717,7 +717,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);