static void finish_commit(struct commit *commit)
{
- if (commit->parents) {
- free_commit_list(commit->parents);
- commit->parents = NULL;
- }
+ free_commit_list(commit->parents);
+ commit->parents = NULL;
free_commit_buffer(the_repository->parsed_objects,
commit);
}
if (item->object.parsed)
return 0;
-
- if (item->parents) {
- /*
- * Presumably this is leftover from an earlier failed parse;
- * clear it out in preparation for us re-parsing (we'll hit the
- * same error, but that's good, since it lets our caller know
- * the result cannot be trusted.
- */
- free_commit_list(item->parents);
- item->parents = NULL;
- }
+ /*
+ * Presumably this is leftover from an earlier failed parse;
+ * clear it out in preparation for us re-parsing (we'll hit the
+ * same error, but that's good, since it lets our caller know
+ * the result cannot be trusted.
+ */
+ free_commit_list(item->parents);
+ item->parents = NULL;
tail += size;
if (tail <= bufptr + tree_entry_len + 1 || memcmp(bufptr, "tree ", 5) ||
expression E;
@@
- if (E)
+(
free(E);
+|
+ free_commit_list(E);
+)
@@
expression E;
@@
- if (!E)
+(
free(E);
+|
+ free_commit_list(E);
+)
@@
expression E;
- free(E);
+ FREE_AND_NULL(E);
- E = NULL;
+
+@@
+expression E;
+@@
+- if (E)
+- {
+ free_commit_list(E);
+ E = NULL;
+- }
+
+@@
+expression E;
+statement S;
+@@
+- if (E) {
++ if (E)
+ S
+ free_commit_list(E);
+- }
if (revs->left_only || revs->right_only)
limit_left_right(newlist, revs);
- if (bottom) {
+ if (bottom)
limit_to_ancestry(bottom, newlist);
- free_commit_list(bottom);
- }
+ free_commit_list(bottom);
/*
* Check if any commits have become TREESAME by some of their parents
* boundary commits anyway. (This is what the code has always
* done.)
*/
- if (revs->commits) {
- free_commit_list(revs->commits);
- revs->commits = NULL;
- }
+ free_commit_list(revs->commits);
+ revs->commits = NULL;
/*
* Put all of the actual boundary commits from revs->boundary_commits
graph_update(revs->graph, c);
if (!c) {
free_saved_parents(revs);
- if (revs->previous_parents) {
- free_commit_list(revs->previous_parents);
- revs->previous_parents = NULL;
- }
+ free_commit_list(revs->previous_parents);
+ revs->previous_parents = NULL;
}
return c;
}
print_submodule_diff_summary(sub, &rev, o);
out:
- if (merge_bases)
- free_commit_list(merge_bases);
+ free_commit_list(merge_bases);
clear_commit_marks(left, ~0);
clear_commit_marks(right, ~0);
if (sub) {
done:
strbuf_release(&sb);
- if (merge_bases)
- free_commit_list(merge_bases);
+ free_commit_list(merge_bases);
if (left)
clear_commit_marks(left, ~0);
if (right)