Skip to content

Commit 4ff7e5c

Browse files
stefanbellergitster
authored andcommitted
commit.c: allow get_cached_commit_buffer to handle arbitrary repositories
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1a40fc4 commit 4ff7e5c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ void set_commit_buffer(struct repository *r, struct commit *commit, void *buffer
283283
v->size = size;
284284
}
285285

286-
const void *get_cached_commit_buffer_the_repository(const struct commit *commit, unsigned long *sizep)
286+
const void *get_cached_commit_buffer(struct repository *r, const struct commit *commit, unsigned long *sizep)
287287
{
288288
struct commit_buffer *v = buffer_slab_peek(
289-
the_repository->parsed_objects->buffer_slab, commit);
289+
r->parsed_objects->buffer_slab, commit);
290290
if (!v) {
291291
if (sizep)
292292
*sizep = 0;

commit.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ void set_commit_buffer(struct repository *r, struct commit *, void *buffer, unsi
103103
* Get any cached object buffer associated with the commit. Returns NULL
104104
* if none. The resulting memory should not be freed.
105105
*/
106-
#define get_cached_commit_buffer(r, c, s) get_cached_commit_buffer_##r(c, s)
107-
const void *get_cached_commit_buffer_the_repository(const struct commit *, unsigned long *size);
106+
const void *get_cached_commit_buffer(struct repository *, const struct commit *, unsigned long *size);
108107

109108
/*
110109
* Get the commit's object contents, either from cache or by reading the object

0 commit comments

Comments
 (0)