提交 1a40fc45 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

commit.c: allow set_commit_buffer to handle arbitrary repositories

Signed-off-by: NStefan Beller <sbeller@google.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 65ea9d4b
......@@ -275,10 +275,10 @@ void free_commit_buffer_slab(struct buffer_slab *bs)
free(bs);
}
void set_commit_buffer_the_repository(struct commit *commit, void *buffer, unsigned long size)
void set_commit_buffer(struct repository *r, struct commit *commit, void *buffer, unsigned long size)
{
struct commit_buffer *v = buffer_slab_at(
the_repository->parsed_objects->buffer_slab, commit);
r->parsed_objects->buffer_slab, commit);
v->buffer = buffer;
v->size = size;
}
......
......@@ -97,8 +97,7 @@ void free_commit_buffer_slab(struct buffer_slab *bs);
* Associate an object buffer with the commit. The ownership of the
* memory is handed over to the commit, and must be free()-able.
*/
#define set_commit_buffer(r, c, b, s) set_commit_buffer_##r(c, b, s)
void set_commit_buffer_the_repository(struct commit *, void *buffer, unsigned long size);
void set_commit_buffer(struct repository *r, struct commit *, void *buffer, unsigned long size);
/*
* Get any cached object buffer associated with the commit. Returns NULL
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册