aboutsummaryrefslogtreecommitdiff
path: root/odb.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-01 14:22:27 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-01 14:46:38 -0700
commitfcf8e3e111ec46705f91151baee40f2c0a3637da (patch)
treead6f80efc085178b284a8ab8fd2773b4f3259782 /odb.h
parentd4ff88aee3967e5d1ef1237cd9b8792b7cdb304c (diff)
downloadgit-fcf8e3e111ec46705f91151baee40f2c0a3637da.tar.xz
odb: rename `has_object()`
Rename `has_object()` to `odb_has_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.h')
-rw-r--r--odb.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/odb.h b/odb.h
index a4a5154fd0..2532c49046 100644
--- a/odb.h
+++ b/odb.h
@@ -372,8 +372,9 @@ enum {
* Returns 1 if the object exists. This function will not lazily fetch objects
* in a partial clone by default.
*/
-int has_object(struct repository *r, const struct object_id *oid,
- unsigned flags);
+int odb_has_object(struct object_database *odb,
+ const struct object_id *oid,
+ unsigned flags);
void odb_assert_oid_type(struct object_database *odb,
const struct object_id *oid, enum object_type expect);
@@ -463,4 +464,11 @@ static inline void *repo_read_object_file(struct repository *r,
return odb_read_object(r->objects, oid, type, size);
}
+static inline int has_object(struct repository *r,
+ const struct object_id *oid,
+ unsigned flags)
+{
+ return odb_has_object(r->objects, oid, flags);
+}
+
#endif /* ODB_H */