aboutsummaryrefslogtreecommitdiffstats
path: root/odb.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-01 14:22:26 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-01 14:46:38 -0700
commitd4ff88aee3967e5d1ef1237cd9b8792b7cdb304c (patch)
tree0951b639fd3ead92506db2216efb384e12bd6cc0 /odb.c
parentodb: rename `oid_object_info()` (diff)
downloadgit-d4ff88aee3967e5d1ef1237cd9b8792b7cdb304c.tar.gz
git-d4ff88aee3967e5d1ef1237cd9b8792b7cdb304c.zip
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>
Diffstat (limited to 'odb.c')
-rw-r--r--odb.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/odb.c b/odb.c
index 40eacdfe2d..5419d5dff6 100644
--- a/odb.c
+++ b/odb.c
@@ -30,7 +30,7 @@ KHASH_INIT(odb_path_map, const char * /* key: odb_path */,
/*
* This is meant to hold a *small* number of objects that you would
- * want repo_read_object_file() to be able to return, but yet you do not want
+ * want odb_read_object() to be able to return, but yet you do not want
* to write them into the object store (e.g. a browse-only
* application).
*/
@@ -887,15 +887,10 @@ int pretend_object_file(struct repository *repo,
return 0;
}
-/*
- * This function dies on corrupt objects; the callers who want to
- * deal with them should arrange to call odb_read_object_info_extended() and give
- * error messages themselves.
- */
-void *repo_read_object_file(struct repository *r,
- const struct object_id *oid,
- enum object_type *type,
- unsigned long *size)
+void *odb_read_object(struct object_database *odb,
+ const struct object_id *oid,
+ enum object_type *type,
+ unsigned long *size)
{
struct object_info oi = OBJECT_INFO_INIT;
unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE;
@@ -904,7 +899,7 @@ void *repo_read_object_file(struct repository *r,
oi.typep = type;
oi.sizep = size;
oi.contentp = &data;
- if (odb_read_object_info_extended(r->objects, oid, &oi, flags))
+ if (odb_read_object_info_extended(odb, oid, &oi, flags))
return NULL;
return data;
@@ -926,7 +921,7 @@ void *read_object_with_reference(struct repository *r,
int ref_length = -1;
const char *ref_type = NULL;
- buffer = repo_read_object_file(r, &actual_oid, &type, &isize);
+ buffer = odb_read_object(r->objects, &actual_oid, &type, &isize);
if (!buffer)
return NULL;
if (type == required_type) {