diff options
Diffstat (limited to 'commit-graph.c')
| -rw-r--r-- | commit-graph.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/commit-graph.c b/commit-graph.c index adffd020dd..06107beedc 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -523,10 +523,13 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r, stat_res = stat(chain_name, &st); free(chain_name); - if (!fp || - stat_res || - st.st_size <= the_hash_algo->hexsz) + if (!fp) return NULL; + if (stat_res || + st.st_size <= the_hash_algo->hexsz) { + fclose(fp); + return NULL; + } count = st.st_size / (the_hash_algo->hexsz + 1); CALLOC_ARRAY(oids, count); @@ -1952,7 +1955,8 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx) } close_commit_graph(ctx->r->objects); - finalize_hashfile(f, file_hash, CSUM_HASH_IN_STREAM | CSUM_FSYNC); + finalize_hashfile(f, file_hash, FSYNC_COMPONENT_COMMIT_GRAPH, + CSUM_HASH_IN_STREAM | CSUM_FSYNC); free_chunkfile(cf); if (ctx->split) { |
