Subject: Re: [PATCH 3/7] oid_object_info(): return "enum object_type"

From: Junio C Hamano <[email-masked]>
Date: Mon, 08 Mar 2021 14:32:27 -0800

Junio C Hamano <[email-masked]> writes:

> And the issue is the same for all the other explicit comparison with
> OBJ_BAD.  If we do it the other way around, i.e. leave these callers
> as they are and add new negative return values to the function first,
> and then convert "if negative, say error" to "if OBJ_BAD, say so,
> else if we have this new type of error, say so", then the risk of
> mistake becomes smaller.
>
> But hopefully any such potential issue will be resolved by the end
> of this short series, so as long as it won't be left as technical
> debt, I am OK.

And after reading through the topic to the end, it turns out that
the code did not add new error return value.  So while it probably
is a good idea to make oid_object_info() to return the enum, I am
not convinced that the updates to the caller that used to check for
the negativeness is an improvement.  Rewriting the ones that used to
compare with -1 for equality to instead compare with OBJ_BAD would
be very much welcome, though.