summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-03-19 15:25:38 -0700
committerJunio C Hamano <gitster@pobox.com>2021-03-19 15:25:38 -0700
commit92ccd7b7529a852583c5033ba28b4414cd2f7654 (patch)
treebce1548bcd2cd806a4524b812fb56f19b397b7d2 /commit-graph.c
parenta8a0ac3234317e47b2510f054a3a5b3d02564c98 (diff)
parent1c57cc70ec26529a26392539fc888486bb89b7fd (diff)
Merge branch 'rs/calloc-array'
CALLOC_ARRAY() macro replaces many uses of xcalloc(). * rs/calloc-array: cocci: allow xcalloc(1, size) use CALLOC_ARRAY git-compat-util.h: drop trailing semicolon from macro definition
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/commit-graph.c b/commit-graph.c
index ca025ce8eb..e21eeea42b 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -516,7 +516,7 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r,
return NULL;
count = st.st_size / (the_hash_algo->hexsz + 1);
- oids = xcalloc(count, sizeof(struct object_id));
+ CALLOC_ARRAY(oids, count);
prepare_alt_odb(r);
@@ -2238,7 +2238,7 @@ int write_commit_graph(struct object_directory *odb,
if (!commit_graph_compatible(the_repository))
return 0;
- ctx = xcalloc(1, sizeof(struct write_commit_graph_context));
+ CALLOC_ARRAY(ctx, 1);
ctx->r = the_repository;
ctx->odb = odb;
ctx->append = flags & COMMIT_GRAPH_WRITE_APPEND ? 1 : 0;