odb: rename repo_read_object_file()
Rename `repo_read_object_file()` to `odb_read_object()` to match other functions related to the object database and our modern coding guidelines. Introduce a compatibility wrapper so that any in-flight topics will continue to compile. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e989dd96b8
commit
d4ff88aee3
@@ -337,13 +337,13 @@ static void *get_delta(struct object_entry *entry)
|
||||
void *buf, *base_buf, *delta_buf;
|
||||
enum object_type type;
|
||||
|
||||
buf = repo_read_object_file(the_repository, &entry->idx.oid, &type,
|
||||
&size);
|
||||
buf = odb_read_object(the_repository->objects, &entry->idx.oid,
|
||||
&type, &size);
|
||||
if (!buf)
|
||||
die(_("unable to read %s"), oid_to_hex(&entry->idx.oid));
|
||||
base_buf = repo_read_object_file(the_repository,
|
||||
&DELTA(entry)->idx.oid, &type,
|
||||
&base_size);
|
||||
base_buf = odb_read_object(the_repository->objects,
|
||||
&DELTA(entry)->idx.oid, &type,
|
||||
&base_size);
|
||||
if (!base_buf)
|
||||
die("unable to read %s",
|
||||
oid_to_hex(&DELTA(entry)->idx.oid));
|
||||
@@ -506,9 +506,9 @@ static unsigned long write_no_reuse_object(struct hashfile *f, struct object_ent
|
||||
&size, NULL)) != NULL)
|
||||
buf = NULL;
|
||||
else {
|
||||
buf = repo_read_object_file(the_repository,
|
||||
&entry->idx.oid, &type,
|
||||
&size);
|
||||
buf = odb_read_object(the_repository->objects,
|
||||
&entry->idx.oid, &type,
|
||||
&size);
|
||||
if (!buf)
|
||||
die(_("unable to read %s"),
|
||||
oid_to_hex(&entry->idx.oid));
|
||||
@@ -1895,7 +1895,7 @@ static struct pbase_tree_cache *pbase_tree_get(const struct object_id *oid)
|
||||
/* Did not find one. Either we got a bogus request or
|
||||
* we need to read and perhaps cache.
|
||||
*/
|
||||
data = repo_read_object_file(the_repository, oid, &type, &size);
|
||||
data = odb_read_object(the_repository->objects, oid, &type, &size);
|
||||
if (!data)
|
||||
return NULL;
|
||||
if (type != OBJ_TREE) {
|
||||
@@ -2762,9 +2762,9 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
|
||||
/* Load data if not already done */
|
||||
if (!trg->data) {
|
||||
packing_data_lock(&to_pack);
|
||||
trg->data = repo_read_object_file(the_repository,
|
||||
&trg_entry->idx.oid, &type,
|
||||
&sz);
|
||||
trg->data = odb_read_object(the_repository->objects,
|
||||
&trg_entry->idx.oid, &type,
|
||||
&sz);
|
||||
packing_data_unlock(&to_pack);
|
||||
if (!trg->data)
|
||||
die(_("object %s cannot be read"),
|
||||
@@ -2777,9 +2777,9 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
|
||||
}
|
||||
if (!src->data) {
|
||||
packing_data_lock(&to_pack);
|
||||
src->data = repo_read_object_file(the_repository,
|
||||
&src_entry->idx.oid, &type,
|
||||
&sz);
|
||||
src->data = odb_read_object(the_repository->objects,
|
||||
&src_entry->idx.oid, &type,
|
||||
&sz);
|
||||
packing_data_unlock(&to_pack);
|
||||
if (!src->data) {
|
||||
if (src_entry->preferred_base) {
|
||||
|
||||
Reference in New Issue
Block a user