summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-05-17 11:41:47 -0700
committerJunio C Hamano <gitster@pobox.com>2019-06-12 11:33:54 -0700
commitc3a3a964b29221a9b5fa305a08037c90b9f74be0 (patch)
tree135c502dec6dcbe723304db33a67f54b2b929916
parentcommit-graph: extract write_commit_graph_file() (diff)
downloadgit-c3a3a964b29221a9b5fa305a08037c90b9f74be0.tar.xz
git-c3a3a964b29221a9b5fa305a08037c90b9f74be0.zip
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--commit-graph.c8
-rw-r--r--commit-graph.h2
-rw-r--r--upload-pack.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 9d2c72f5b4a..76d189de454 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -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);
diff --git a/commit-graph.h b/commit-graph.h
index 01538b5cf59..390c7f69610 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -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
diff --git a/upload-pack.c b/upload-pack.c
index d098ef59828..b51bed21e40 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -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);