aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-01-15 10:35:34 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-15 05:32:31 -0800
commit9f18d089c51fba2776fe1fece877a359c47417f7 (patch)
treee51d5ec9b79ebda7f0b928d7c71f4d36adad4a81 /commit.c
parenta468f3cefab32eed7d9a12bd6b93719d38ec67a6 (diff)
downloadgit-9f18d089c51fba2776fe1fece877a359c47417f7.tar.xz
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>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/commit.c b/commit.c
index 36f02c96aa..ddda9ee19d 100644
--- a/commit.c
+++ b/commit.c
@@ -191,7 +191,7 @@ void unparse_commit(struct repository *r, const struct object_id *oid)
if (!c->object.parsed)
return;
- free_commit_list(c->parents);
+ commit_list_free(c->parents);
c->parents = NULL;
c->object.parsed = 0;
}
@@ -436,7 +436,7 @@ void release_commit_memory(struct parsed_object_pool *pool, struct commit *c)
set_commit_tree(c, NULL);
free_commit_buffer(pool, c);
c->index = 0;
- free_commit_list(c->parents);
+ commit_list_free(c->parents);
c->object.parsed = 0;
}
@@ -480,7 +480,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b
* same error, but that's good, since it lets our caller know
* the result cannot be trusted.
*/
- free_commit_list(item->parents);
+ commit_list_free(item->parents);
item->parents = NULL;
tail += size;
@@ -702,7 +702,7 @@ struct commit_list *commit_list_reverse(struct commit_list *list)
return next;
}
-void free_commit_list(struct commit_list *list)
+void commit_list_free(struct commit_list *list)
{
while (list)
pop_commit(&list);
@@ -977,7 +977,7 @@ void sort_in_topological_order(struct commit_list **list, enum rev_sort_order so
prio_queue_reverse(&queue);
/* We no longer need the commit list */
- free_commit_list(orig);
+ commit_list_free(orig);
pptr = list;
*list = NULL;
@@ -1107,7 +1107,7 @@ struct commit *get_fork_point(const char *refname, struct commit *commit)
cleanup_return:
free(revs.commit);
- free_commit_list(bases);
+ commit_list_free(bases);
free(full_refname);
return ret;
}