cocci: apply the "commit.h" part of "the_repository.pending"
Apply the part of "the_repository.pending.cocci" pertaining to "commit.h". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
cb338c23d6
commit
ecb5091fd4
25
commit.c
25
commit.c
@ -83,7 +83,7 @@ struct commit *lookup_commit_reference_by_name(const char *name)
|
||||
if (repo_get_oid_committish(the_repository, name, &oid))
|
||||
return NULL;
|
||||
commit = lookup_commit_reference(the_repository, &oid);
|
||||
if (parse_commit(commit))
|
||||
if (repo_parse_commit(the_repository, commit))
|
||||
return NULL;
|
||||
return commit;
|
||||
}
|
||||
@ -382,7 +382,7 @@ struct tree *repo_get_commit_tree(struct repository *r,
|
||||
|
||||
struct object_id *get_commit_tree_oid(const struct commit *commit)
|
||||
{
|
||||
struct tree *tree = get_commit_tree(commit);
|
||||
struct tree *tree = repo_get_commit_tree(the_repository, commit);
|
||||
return tree ? &tree->object.oid : NULL;
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ int repo_parse_commit_gently(struct repository *r,
|
||||
|
||||
void parse_commit_or_die(struct commit *item)
|
||||
{
|
||||
if (parse_commit(item))
|
||||
if (repo_parse_commit(the_repository, item))
|
||||
die("unable to parse commit %s",
|
||||
item ? oid_to_hex(&item->object.oid) : "(null)");
|
||||
}
|
||||
@ -688,7 +688,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
|
||||
|
||||
while (parents) {
|
||||
struct commit *commit = parents->item;
|
||||
if (!parse_commit(commit) && !(commit->object.flags & mark)) {
|
||||
if (!repo_parse_commit(the_repository, commit) && !(commit->object.flags & mark)) {
|
||||
commit->object.flags |= mark;
|
||||
commit_list_insert_by_date(commit, list);
|
||||
}
|
||||
@ -762,7 +762,8 @@ define_commit_slab(author_date_slab, timestamp_t);
|
||||
void record_author_date(struct author_date_slab *author_date,
|
||||
struct commit *commit)
|
||||
{
|
||||
const char *buffer = get_commit_buffer(commit, NULL);
|
||||
const char *buffer = repo_get_commit_buffer(the_repository, commit,
|
||||
NULL);
|
||||
struct ident_split ident;
|
||||
const char *ident_line;
|
||||
size_t ident_len;
|
||||
@ -782,7 +783,7 @@ void record_author_date(struct author_date_slab *author_date,
|
||||
*(author_date_slab_at(author_date, commit)) = date;
|
||||
|
||||
fail_exit:
|
||||
unuse_commit_buffer(commit, buffer);
|
||||
repo_unuse_commit_buffer(the_repository, commit, buffer);
|
||||
}
|
||||
|
||||
int compare_commits_by_author_date(const void *a_, const void *b_,
|
||||
@ -963,7 +964,7 @@ static void add_one_commit(struct object_id *oid, struct rev_collect *revs)
|
||||
commit = lookup_commit(the_repository, oid);
|
||||
if (!commit ||
|
||||
(commit->object.flags & TMP_MARK) ||
|
||||
parse_commit(commit))
|
||||
repo_parse_commit(the_repository, commit))
|
||||
return;
|
||||
|
||||
ALLOC_GROW(revs->commit, revs->nr + 1, revs->alloc);
|
||||
@ -1096,10 +1097,11 @@ int parse_signed_commit(const struct commit *commit,
|
||||
const struct git_hash_algo *algop)
|
||||
{
|
||||
unsigned long size;
|
||||
const char *buffer = get_commit_buffer(commit, &size);
|
||||
const char *buffer = repo_get_commit_buffer(the_repository, commit,
|
||||
&size);
|
||||
int ret = parse_buffer_signed_by_header(buffer, size, payload, signature, algop);
|
||||
|
||||
unuse_commit_buffer(commit, buffer);
|
||||
repo_unuse_commit_buffer(the_repository, commit, buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1318,9 +1320,10 @@ struct commit_extra_header *read_commit_extra_headers(struct commit *commit,
|
||||
{
|
||||
struct commit_extra_header *extra = NULL;
|
||||
unsigned long size;
|
||||
const char *buffer = get_commit_buffer(commit, &size);
|
||||
const char *buffer = repo_get_commit_buffer(the_repository, commit,
|
||||
&size);
|
||||
extra = read_commit_extra_header_lines(buffer, size, exclude);
|
||||
unuse_commit_buffer(commit, buffer);
|
||||
repo_unuse_commit_buffer(the_repository, commit, buffer);
|
||||
return extra;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user