diff options
Diffstat (limited to 'commit-graph.c')
-rw-r--r-- | commit-graph.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/commit-graph.c b/commit-graph.c index 2b52818731..7943da3848 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); @@ -2569,7 +2572,7 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags) odb_parents = odb_commit->parents; while (graph_parents) { - if (odb_parents == NULL) { + if (!odb_parents) { graph_report(_("commit-graph parent list for commit %s is too long"), oid_to_hex(&cur_oid)); break; @@ -2592,7 +2595,7 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags) odb_parents = odb_parents->next; } - if (odb_parents != NULL) + if (odb_parents) graph_report(_("commit-graph parent list for commit %s terminates early"), oid_to_hex(&cur_oid)); |