Merge branch 'ps/object-file-wo-the-repository'
Reduce implicit assumption and dependence on the_repository in the object-file subsystem. * ps/object-file-wo-the-repository: object-file: get rid of `the_repository` in index-related functions object-file: get rid of `the_repository` in `force_object_loose()` object-file: get rid of `the_repository` in `read_loose_object()` object-file: get rid of `the_repository` in loose object iterators object-file: remove declaration for `for_each_file_in_obj_subdir()` object-file: inline `for_each_loose_file_in_objdir_buf()` object-file: get rid of `the_repository` when writing objects odb: introduce `odb_write_object()` loose: write loose objects map via their source object-file: get rid of `the_repository` in `finalize_object_file()` object-file: get rid of `the_repository` in `loose_object_info()` object-file: get rid of `the_repository` when freshening objects object-file: inline `check_and_freshen()` functions object-file: get rid of `the_repository` in `has_loose_object()` object-file: stop using `the_hash_algo` object-file: fix -Wsign-compare warnings
This commit is contained in:
@@ -204,8 +204,8 @@ static void write_cached_object(struct object *obj, struct obj_buffer *obj_buf)
|
||||
{
|
||||
struct object_id oid;
|
||||
|
||||
if (write_object_file(obj_buf->buffer, obj_buf->size,
|
||||
obj->type, &oid) < 0)
|
||||
if (odb_write_object(the_repository->objects, obj_buf->buffer, obj_buf->size,
|
||||
obj->type, &oid) < 0)
|
||||
die("failed to write object %s", oid_to_hex(&obj->oid));
|
||||
obj->flags |= FLAG_WRITTEN;
|
||||
}
|
||||
@@ -272,16 +272,16 @@ static void write_object(unsigned nr, enum object_type type,
|
||||
void *buf, unsigned long size)
|
||||
{
|
||||
if (!strict) {
|
||||
if (write_object_file(buf, size, type,
|
||||
&obj_list[nr].oid) < 0)
|
||||
if (odb_write_object(the_repository->objects, buf, size, type,
|
||||
&obj_list[nr].oid) < 0)
|
||||
die("failed to write object");
|
||||
added_object(nr, type, buf, size);
|
||||
free(buf);
|
||||
obj_list[nr].obj = NULL;
|
||||
} else if (type == OBJ_BLOB) {
|
||||
struct blob *blob;
|
||||
if (write_object_file(buf, size, type,
|
||||
&obj_list[nr].oid) < 0)
|
||||
if (odb_write_object(the_repository->objects, buf, size, type,
|
||||
&obj_list[nr].oid) < 0)
|
||||
die("failed to write object");
|
||||
added_object(nr, type, buf, size);
|
||||
free(buf);
|
||||
@@ -403,7 +403,8 @@ static void stream_blob(unsigned long size, unsigned nr)
|
||||
data.zstream = &zstream;
|
||||
git_inflate_init(&zstream);
|
||||
|
||||
if (stream_loose_object(&in_stream, size, &info->oid))
|
||||
if (stream_loose_object(the_repository->objects->sources,
|
||||
&in_stream, size, &info->oid))
|
||||
die(_("failed to write object in stream"));
|
||||
|
||||
if (data.status != Z_STREAM_END)
|
||||
|
||||
Reference in New Issue
Block a user