]> git.ipfire.org Git - thirdparty/git.git/commitdiff
odb: fix flags parameter to be unsigned
authorPatrick Steinhardt <ps@pks.im>
Thu, 15 Jan 2026 11:04:31 +0000 (12:04 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 Jan 2026 13:50:27 +0000 (05:50 -0800)
The `flags` parameter accepted by various `for_each_object()` functions
is a bitfield of multiple flags. Such parameters are typically unsigned
in the Git codebase, but we use `enum odb_for_each_object_flags` in
some places.

Adapt these function signatures to use the correct type.

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

index 64e9e239dc341a6083bbe45cc3d054e13048c72e..8fa461dd5966151575fa040da5e5c5ae52ffa014 100644 (file)
@@ -414,7 +414,8 @@ static int parse_loose_header(const char *hdr, struct object_info *oi)
 
 int odb_source_loose_read_object_info(struct odb_source *source,
                                      const struct object_id *oid,
-                                     struct object_info *oi, int flags)
+                                     struct object_info *oi,
+                                     unsigned flags)
 {
        int ret;
        int fd;
index 42bb50e10cf296c657ddc91fcc131a31b2fe95a2..2acf19fb91ab4121b080de572202123530ea3379 100644 (file)
@@ -47,7 +47,8 @@ void odb_source_loose_reprepare(struct odb_source *source);
 
 int odb_source_loose_read_object_info(struct odb_source *source,
                                      const struct object_id *oid,
-                                     struct object_info *oi, int flags);
+                                     struct object_info *oi,
+                                     unsigned flags);
 
 int odb_source_loose_read_object_stream(struct odb_read_stream **out,
                                        struct odb_source *source,
index b65f0b43f16eb38f3988750324186588f188bd6a..79fe64a25b2f5ea962a485375e6bc6ae6999c6a0 100644 (file)
@@ -2259,7 +2259,7 @@ int has_object_kept_pack(struct repository *r, const struct object_id *oid,
 
 int for_each_object_in_pack(struct packed_git *p,
                            each_packed_object_fn cb, void *data,
-                           enum odb_for_each_object_flags flags)
+                           unsigned flags)
 {
        uint32_t i;
        int r = 0;
@@ -2302,7 +2302,7 @@ int for_each_object_in_pack(struct packed_git *p,
 }
 
 int for_each_packed_object(struct repository *repo, each_packed_object_fn cb,
-                          void *data, enum odb_for_each_object_flags flags)
+                          void *data, unsigned flags)
 {
        struct odb_source *source;
        int r = 0;
index 15551258bde5191a41da79fbe0c3e999ea9b1e1c..447c44c4a7517dd03c64c3a1b4e547cd617eb010 100644 (file)
@@ -339,9 +339,9 @@ typedef int each_packed_object_fn(const struct object_id *oid,
                                  void *data);
 int for_each_object_in_pack(struct packed_git *p,
                            each_packed_object_fn, void *data,
-                           enum odb_for_each_object_flags flags);
+                           unsigned flags);
 int for_each_packed_object(struct repository *repo, each_packed_object_fn cb,
-                          void *data, enum odb_for_each_object_flags flags);
+                          void *data, unsigned flags);
 
 /* A hook to report invalid files in pack directory */
 #define PACKDIR_FILE_PACK 1