From f6516a5241684355f3fb9f7b70e287e98b48d0ef Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 12 Feb 2026 07:59:40 +0100 Subject: odb: convert object info flags into an enum Convert the object info flags into an enum and adapt all functions that receive these flags as parameters to use the enum instead of an integer. This serves two purposes: - The function signatures become more self-documenting, as callers don't have to wonder which flags they expect. - The compiler can warn when a wrong flag type is passed. Note that the second benefit is somewhat limited. For example, when or-ing multiple enum flags together the result will be an integer, and the compiler will not warn about such use cases. But where it does help is when a single flag of the wrong type is passed, as the compiler would generate a warning in that case. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- packfile.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packfile.h') diff --git a/packfile.h b/packfile.h index acc5c55ad5..989fd10cb6 100644 --- a/packfile.h +++ b/packfile.h @@ -247,7 +247,7 @@ int packfile_store_read_object_stream(struct odb_read_stream **out, int packfile_store_read_object_info(struct packfile_store *store, const struct object_id *oid, struct object_info *oi, - unsigned flags); + enum object_info_flags flags); /* * Open the packfile and add it to the store if it isn't yet known. Returns -- cgit v1.3-6-g1900