]> git.ipfire.org Git - thirdparty/git.git/commitdiff
treewide: use enum for `odb_for_each_object()` flags
authorPatrick Steinhardt <ps@pks.im>
Tue, 31 Mar 2026 23:57:47 +0000 (01:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Apr 2026 03:43:13 +0000 (20:43 -0700)
We've got a couple of callsites where we pass `odb_for_each_object()`
flags, but accept an `unsigned` flags field instead of the corresponding
enum. Adapt these to accept the enum type instead.

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

diff --git a/odb.c b/odb.c
index 3f94a53df157e1292d46415b31328f07cbfb6c80..9a11c600487ded2825844f3bcd264aff5c488bdd 100644 (file)
--- a/odb.c
+++ b/odb.c
@@ -922,7 +922,7 @@ int odb_for_each_object(struct object_database *odb,
                        const struct object_info *request,
                        odb_for_each_object_cb cb,
                        void *cb_data,
-                       unsigned flags)
+                       enum odb_for_each_object_flags flags)
 {
        struct odb_for_each_object_options opts = {
                .flags = flags,
diff --git a/odb.h b/odb.h
index 984bafca9d652b94e1b1edd13a30f1c83ebb0aab..09affaf6a58e67726ecd76948aed1d9365190000 100644 (file)
--- a/odb.h
+++ b/odb.h
@@ -522,7 +522,7 @@ int odb_for_each_object(struct object_database *odb,
                        const struct object_info *request,
                        odb_for_each_object_cb cb,
                        void *cb_data,
-                       unsigned flags);
+                       enum odb_for_each_object_flags flags);
 
 enum odb_count_objects_flags {
        /*
index ee9c7ea1d142ec6bcaf447a47b9a3c084e2780cc..5d3b772973b06cd1ba4308408d02902a3bb0f9c4 100644 (file)
@@ -2299,7 +2299,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,
-                           unsigned flags)
+                           enum odb_for_each_object_flags flags)
 {
        uint32_t i;
        int r = 0;
index 45b35973f07b370d8e51bdf500bca91fca8bed38..3eb10d6b6567bf9d7a7f8808df30c47f43ff8625 100644 (file)
@@ -352,7 +352,7 @@ 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,
-                           unsigned flags);
+                           enum odb_for_each_object_flags flags);
 
 /*
  * Iterate through all packed objects in the given packfile store and invoke