Conversation
`git_oid_iszero` has been deprecated.
Raw git_oid binding has an extra field for object format kind. The old all-zeroed struct is now an valid oid when the feature `unstable-sha256` is enabled. This adds an warning to the `Oid::zero` function that it should only be used an output parameter when talking to C API. If you need valid zeroed input parameter, use libgit2 constants `GIT_OID_SHA*_ZERO` instead.
ehuss
left a comment
There was a problem hiding this comment.
Thanks!
I have some doubts if it makes sense to allow kind to be 0 in all situations, since that seems to be an invalid kind. But I don't immediately see any concerns.
Good call out! For output param specifically, kind being 0 should be fine. libgit2 seems to always set out->type based on the type parameter passed to the function or the surrounding context. For input param, user should not use |
typefield to git_oid struct)git_oid_iszerois deprecated. Usegit_oid_is_zeroinstead.(Spun off from #1202)