Skip to content

Commit 1a40fc4

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

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
@@ -275,10 +275,10 @@ void free_commit_buffer_slab(struct buffer_slab *bs)
275275
free(bs);
276276
}
277277

278-
void set_commit_buffer_the_repository(struct commit *commit, void *buffer, unsigned long size)
278+
void set_commit_buffer(struct repository *r, struct commit *commit, void *buffer, unsigned long size)
279279
{
280280
struct commit_buffer *v = buffer_slab_at(
281-
the_repository->parsed_objects->buffer_slab, commit);
281+
r->parsed_objects->buffer_slab, commit);
282282
v->buffer = buffer;
283283
v->size = size;
284284
}

commit.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ void free_commit_buffer_slab(struct buffer_slab *bs);
9797
* Associate an object buffer with the commit. The ownership of the
9898
* memory is handed over to the commit, and must be free()-able.
9999
*/
100-
#define set_commit_buffer(r, c, b, s) set_commit_buffer_##r(c, b, s)
101-
void set_commit_buffer_the_repository(struct commit *, void *buffer, unsigned long size);
100+
void set_commit_buffer(struct repository *r, struct commit *, void *buffer, unsigned long size);
102101

103102
/*
104103
* Get any cached object buffer associated with the commit. Returns NULL

0 commit comments

Comments
 (0)