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:
Patrick Steinhardt
2025-07-01 14:22:26 +02:00
committed by Junio C Hamano
parent e989dd96b8
commit d4ff88aee3
47 changed files with 157 additions and 150 deletions

13
notes.c
View File

@@ -816,15 +816,15 @@ int combine_notes_concatenate(struct object_id *cur_oid,
/* read in both note blob objects */
if (!is_null_oid(new_oid))
new_msg = repo_read_object_file(the_repository, new_oid,
&new_type, &new_len);
new_msg = odb_read_object(the_repository->objects, new_oid,
&new_type, &new_len);
if (!new_msg || !new_len || new_type != OBJ_BLOB) {
free(new_msg);
return 0;
}
if (!is_null_oid(cur_oid))
cur_msg = repo_read_object_file(the_repository, cur_oid,
&cur_type, &cur_len);
cur_msg = odb_read_object(the_repository->objects, cur_oid,
&cur_type, &cur_len);
if (!cur_msg || !cur_len || cur_type != OBJ_BLOB) {
free(cur_msg);
free(new_msg);
@@ -880,7 +880,7 @@ static int string_list_add_note_lines(struct string_list *list,
return 0;
/* read_sha1_file NUL-terminates */
data = repo_read_object_file(the_repository, oid, &t, &len);
data = odb_read_object(the_repository->objects, oid, &t, &len);
if (t != OBJ_BLOB || !data || !len) {
free(data);
return t != OBJ_BLOB || !data;
@@ -1290,7 +1290,8 @@ static void format_note(struct notes_tree *t, const struct object_id *object_oid
if (!oid)
return;
if (!(msg = repo_read_object_file(the_repository, oid, &type, &msglen)) || type != OBJ_BLOB) {
if (!(msg = odb_read_object(the_repository->objects, oid, &type, &msglen)) ||
type != OBJ_BLOB) {
free(msg);
return;
}