commit: rename free_commit_list() to conform to coding guidelines

Our coding guidelines say that:

  Functions that operate on `struct S` are named `S_<verb>()` and should
  generally receive a pointer to `struct S` as first parameter.

While most of the functions related to `struct commit_list` already
follow that naming schema, `free_commit_list()` doesn't.

Rename the function to address this and adjust all of its callers. Add a
compatibility wrapper for the old function name to ease the transition
and avoid any semantic conflicts with in-flight patch series. This
wrapper will be removed once Git 2.53 has been released.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2026-01-15 10:35:34 +01:00
committed by Junio C Hamano
parent a468f3cefa
commit 9f18d089c5
40 changed files with 136 additions and 131 deletions

View File

@@ -33,7 +33,7 @@ static int stdin_diff_commit(struct commit *commit, const char *p)
struct commit *parent = lookup_commit(the_repository, &oid);
if (!pptr) {
/* Free the real parent list */
free_commit_list(commit->parents);
commit_list_free(commit->parents);
commit->parents = NULL;
pptr = &(commit->parents);
}