summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-01-26 10:51:18 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-26 08:26:06 -0800
commit6358da200fffc7f010f079c3f64ed77f10cd751d (patch)
tree97aef7f6f6beb3940854c54fdf9f8b974b1f41ac
parentbd1855b89760cc0f9a185010a0d92d2e11a73132 (diff)
downloadgit-6358da200fffc7f010f079c3f64ed77f10cd751d.tar.gz
git-6358da200fffc7f010f079c3f64ed77f10cd751d.zip
odb: fix flags parameter to be unsigned
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>
-rw-r--r--object-file.c3
-rw-r--r--object-file.h3
-rw-r--r--packfile.c4
-rw-r--r--packfile.h4
4 files changed, 8 insertions, 6 deletions
diff --git a/object-file.c b/object-file.c
index 64e9e239dc..8fa461dd59 100644
--- a/object-file.c
+++ b/object-file.c
@@ -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;
diff --git a/object-file.h b/object-file.h
index 42bb50e10c..2acf19fb91 100644
--- a/object-file.h
+++ b/object-file.h
@@ -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,
diff --git a/packfile.c b/packfile.c
index b65f0b43f1..79fe64a25b 100644
--- a/packfile.c
+++ b/packfile.c
@@ -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;
diff --git a/packfile.h b/packfile.h
index 15551258bd..447c44c4a7 100644
--- a/packfile.h
+++ b/packfile.h
@@ -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