diff options
Diffstat (limited to 'commit-graph.c')
-rw-r--r-- | commit-graph.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/commit-graph.c b/commit-graph.c index f2a36032f8..5e6098ff35 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -1,5 +1,6 @@ #include "git-compat-util.h" #include "config.h" +#include "hex.h" #include "lockfile.h" #include "pack.h" #include "packfile.h" @@ -901,7 +902,7 @@ struct commit *lookup_commit_in_graph(struct repository *repo, const struct obje struct commit *commit; uint32_t pos; - if (!repo->objects->commit_graph) + if (!prepare_commit_graph(repo)) return NULL; if (!search_commit_pos_in_graph(id, repo->objects->commit_graph, &pos)) return NULL; @@ -1594,8 +1595,7 @@ static void compute_bloom_filters(struct write_commit_graph_context *ctx) _("Computing commit changed paths Bloom filters"), ctx->commits.nr); - ALLOC_ARRAY(sorted_commits, ctx->commits.nr); - COPY_ARRAY(sorted_commits, ctx->commits.list, ctx->commits.nr); + DUP_ARRAY(sorted_commits, ctx->commits.list, ctx->commits.nr); if (ctx->order_by_pack) QSORT(sorted_commits, ctx->commits.nr, commit_pos_cmp); @@ -1639,9 +1639,9 @@ struct refs_cb_data { struct progress *progress; }; -static int add_ref_to_set(const char *refname, +static int add_ref_to_set(const char *refname UNUSED, const struct object_id *oid, - int flags, void *cb_data) + int flags UNUSED, void *cb_data) { struct object_id peeled; struct refs_cb_data *data = (struct refs_cb_data *)cb_data; @@ -2265,6 +2265,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) } out: + if(dir) + closedir(dir); strbuf_release(&path); } |