]> git.ipfire.org Git - thirdparty/git.git/commitdiff
object-file: rename `has_loose_object()`
authorPatrick Steinhardt <ps@pks.im>
Mon, 3 Nov 2025 07:42:05 +0000 (08:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Nov 2025 20:18:47 +0000 (12:18 -0800)
Rename `has_loose_object()` to `odb_source_loose_has_object()` so that
it becomes clear that this is tied to a specific loose object source.
This matches our modern naming schema for functions.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c
object-file.c
object-file.h

index b5454e5df137b44dfd1b75780b65b479f233c5a1..69e80b1443a9b76d79d51920853371a2ea486d6b 100644 (file)
@@ -1716,7 +1716,7 @@ static int want_object_in_pack_mtime(const struct object_id *oid,
                 */
                struct odb_source *source = the_repository->objects->sources->next;
                for (; source; source = source->next)
-                       if (has_loose_object(source, oid))
+                       if (odb_source_loose_has_object(source, oid))
                                return 0;
        }
 
@@ -3978,7 +3978,7 @@ static void add_cruft_object_entry(const struct object_id *oid, enum object_type
                        int found = 0;
 
                        for (; !found && source; source = source->next)
-                               if (has_loose_object(source, oid))
+                               if (odb_source_loose_has_object(source, oid))
                                        found = 1;
 
                        /*
index 6d6e9a5a2ad3c816f2465b3e443880e409ccbc1d..79e7ab8d2e3d0e8c64246aa90aa272b954f35fb4 100644 (file)
@@ -99,8 +99,8 @@ static int check_and_freshen_source(struct odb_source *source,
        return check_and_freshen_file(path.buf, freshen);
 }
 
-int has_loose_object(struct odb_source *source,
-                    const struct object_id *oid)
+int odb_source_loose_has_object(struct odb_source *source,
+                               const struct object_id *oid)
 {
        return check_and_freshen_source(source, oid, 0);
 }
@@ -1161,7 +1161,7 @@ int force_object_loose(struct odb_source *source,
        int ret;
 
        for (struct odb_source *s = source->odb->sources; s; s = s->next)
-               if (has_loose_object(s, oid))
+               if (odb_source_loose_has_object(s, oid))
                        return 0;
 
        oi.typep = &type;
index ca13d3d64e722bafb6340a5fb62ac201b79be361..065a44bb8a019e62a34bb4b92a0528cf161773ca 100644 (file)
@@ -51,6 +51,14 @@ void *odb_source_loose_map_object(struct odb_source *source,
                                  const struct object_id *oid,
                                  unsigned long *size);
 
+/*
+ * Return true iff an object database source has a loose object
+ * with the specified name.  This function does not respect replace
+ * references.
+ */
+int odb_source_loose_has_object(struct odb_source *source,
+                               const struct object_id *oid);
+
 /*
  * Populate and return the loose object cache array corresponding to the
  * given object ID.
@@ -66,14 +74,6 @@ const char *odb_loose_path(struct odb_source *source,
                           struct strbuf *buf,
                           const struct object_id *oid);
 
-/*
- * Return true iff an object database source has a loose object
- * with the specified name.  This function does not respect replace
- * references.
- */
-int has_loose_object(struct odb_source *source,
-                    const struct object_id *oid);
-
 /*
  * Iterate over the files in the loose-object parts of the object
  * directory "path", triggering the following callbacks: