Merge branch 'kh/free-commit-list'

Code clean-up.

* kh/free-commit-list:
  commit: remove deprecated functions
  *: replace deprecated free_commit_list
main
Junio C Hamano 2026-06-07 23:58:24 +09:00
commit 92b870a675
4 changed files with 5 additions and 24 deletions

View File

@ -284,7 +284,7 @@ static int setup_revwalk(struct repository *repo,

commit_list_insert(original, &from_list);
ret = repo_is_descendant_of(repo, head, from_list);
free_commit_list(from_list);
commit_list_free(from_list);

if (ret < 0) {
ret = error(_("cannot determine descendance"));
@ -892,7 +892,7 @@ out:
if (index_file.len)
unlink(index_file.buf);
strbuf_release(&index_file);
free_commit_list(parents);
commit_list_free(parents);
release_index(&index);
return ret;
}

View File

@ -203,25 +203,6 @@ struct commit_list *commit_list_reverse(struct commit_list *list);

void commit_list_free(struct commit_list *list);

/*
* Deprecated compatibility functions for `struct commit_list`, to be removed
* once Git 2.53 is released.
*/
static inline struct commit_list *copy_commit_list(struct commit_list *l)
{
return commit_list_copy(l);
}

static inline struct commit_list *reverse_commit_list(struct commit_list *l)
{
return commit_list_reverse(l);
}

static inline void free_commit_list(struct commit_list *l)
{
commit_list_free(l);
}

struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */

const char *repo_logmsg_reencode(struct repository *r,

View File

@ -120,7 +120,7 @@ static struct commit *create_commit(struct repository *repo,
out:
repo_unuse_commit_buffer(repo, based_on, message);
free_commit_extra_headers(extra);
free_commit_list(parents);
commit_list_free(parents);
strbuf_release(&msg);
free(author);
return (struct commit *)obj;

View File

@ -886,7 +886,7 @@ static void deepen(struct upload_pack_data *data, int depth)
data->deepen_relative, depth,
SHALLOW, NOT_SHALLOW);
send_shallow(data, result);
free_commit_list(result);
commit_list_free(result);
}

send_unshallow(data);
@ -900,7 +900,7 @@ static void deepen_by_rev_list(struct upload_pack_data *data,
disable_commit_graph(the_repository);
result = get_shallow_commits_by_rev_list(argv, SHALLOW, NOT_SHALLOW);
send_shallow(data, result);
free_commit_list(result);
commit_list_free(result);
send_unshallow(data);
}