From 9f18d089c51fba2776fe1fece877a359c47417f7 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 15 Jan 2026 10:35:34 +0100 Subject: commit: rename `free_commit_list()` to conform to coding guidelines Our coding guidelines say that: Functions that operate on `struct S` are named `S_()` 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 Signed-off-by: Junio C Hamano --- commit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'commit.c') 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; } -- cgit v1.3