aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-02-13 13:39:25 -0800
committerJunio C Hamano <gitster@pobox.com>2026-02-13 13:39:25 -0800
commit528820243334c55e015047477e720a14bc9cf25f (patch)
tree773eaf04a82524688f5fb95c3c7d0453720d192b /commit.c
parent70cc3bca87abdfbc941e98d1c0d3199f758f0990 (diff)
parent9f18d089c51fba2776fe1fece877a359c47417f7 (diff)
downloadgit-528820243334c55e015047477e720a14bc9cf25f.tar.xz
Merge branch 'ps/commit-list-functions-renamed'
Rename three functions around the commit_list data structure. * ps/commit-list-functions-renamed: commit: rename `free_commit_list()` to conform to coding guidelines commit: rename `reverse_commit_list()` to conform to coding guidelines commit: rename `copy_commit_list()` to conform to coding guidelines
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/commit.c b/commit.c
index 28bb5ce029..9bb471d217 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;
@@ -680,7 +680,7 @@ unsigned commit_list_count(const struct commit_list *l)
return c;
}
-struct commit_list *copy_commit_list(const struct commit_list *list)
+struct commit_list *commit_list_copy(const struct commit_list *list)
{
struct commit_list *head = NULL;
struct commit_list **pp = &head;
@@ -691,7 +691,7 @@ struct commit_list *copy_commit_list(const struct commit_list *list)
return head;
}
-struct commit_list *reverse_commit_list(struct commit_list *list)
+struct commit_list *commit_list_reverse(struct commit_list *list)
{
struct commit_list *next = NULL, *current, *backup;
for (current = list; current; current = backup) {
@@ -702,7 +702,7 @@ struct commit_list *reverse_commit_list(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;
}