]> Kevux Git Server - rit/commit
odb: convert object info flags into an enum
authorPatrick Steinhardt <ps@pks.im>
Thu, 12 Feb 2026 06:59:40 +0000 (07:59 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Feb 2026 19:05:08 +0000 (11:05 -0800)
commitf6516a5241684355f3fb9f7b70e287e98b48d0ef
treec047f41fc243eae618dadb37fb609dfc68120d0e
parentae77afc3478c87766c4db9082fa82195d6ce9560
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 <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.c
object-file.h
odb.c
odb.h
packfile.c
packfile.h