aboutsummaryrefslogtreecommitdiff
path: root/odb.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-01 14:22:28 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-01 14:46:38 -0700
commit08218b8cd4b54468bbb7cd09454a630ca4209d1a (patch)
tree241a87c8169c3c2ccf07c19e7707fea7fce7c1f2 /odb.c
parentfcf8e3e111ec46705f91151baee40f2c0a3637da (diff)
downloadgit-08218b8cd4b54468bbb7cd09454a630ca4209d1a.tar.xz
odb: rename `pretend_object_file()`
Rename `pretend_object_file()` to `odb_pretend_object()` to match other functions related to the object database and our modern coding guidelines. No compatibility wrapper is introduced as the function is not used a lot throughout our codebase. 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.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/odb.c b/odb.c
index ecb6711a27..217903d7b1 100644
--- a/odb.c
+++ b/odb.c
@@ -863,21 +863,21 @@ int odb_read_object_info(struct object_database *odb,
return type;
}
-int pretend_object_file(struct repository *repo,
- void *buf, unsigned long len, enum object_type type,
- struct object_id *oid)
+int odb_pretend_object(struct object_database *odb,
+ void *buf, unsigned long len, enum object_type type,
+ struct object_id *oid)
{
struct cached_object_entry *co;
char *co_buf;
- hash_object_file(repo->hash_algo, buf, len, type, oid);
- if (odb_has_object(repo->objects, oid, 0) ||
- find_cached_object(repo->objects, oid))
+ hash_object_file(odb->repo->hash_algo, buf, len, type, oid);
+ if (odb_has_object(odb, oid, 0) ||
+ find_cached_object(odb, oid))
return 0;
- ALLOC_GROW(repo->objects->cached_objects,
- repo->objects->cached_object_nr + 1, repo->objects->cached_object_alloc);
- co = &repo->objects->cached_objects[repo->objects->cached_object_nr++];
+ ALLOC_GROW(odb->cached_objects,
+ odb->cached_object_nr + 1, odb->cached_object_alloc);
+ co = &odb->cached_objects[odb->cached_object_nr++];
co->value.size = len;
co->value.type = type;
co_buf = xmalloc(len);