commit: prepare repo_unuse_commit_buffer to handle any repo
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
07de3fd840
commit
70315373ae
6
commit.c
6
commit.c
@ -318,10 +318,12 @@ const void *repo_get_commit_buffer(struct repository *r,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void unuse_commit_buffer(const struct commit *commit, const void *buffer)
|
||||
void repo_unuse_commit_buffer(struct repository *r,
|
||||
const struct commit *commit,
|
||||
const void *buffer)
|
||||
{
|
||||
struct commit_buffer *v = buffer_slab_peek(
|
||||
the_repository->parsed_objects->buffer_slab, commit);
|
||||
r->parsed_objects->buffer_slab, commit);
|
||||
if (!(v && v->buffer == buffer))
|
||||
free((void *)buffer);
|
||||
}
|
||||
|
Reference in New Issue
Block a user