Re: [PATCH v5 1/3] refs: allow callers to supply old OIDs for batch deletion
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 24, 2026, 16:34 UTC
- Message-ID
- <xmqq8q4q4nh4.fsf@gitster.g>
- In-Reply-To
- <CAOLa=ZTWq6eiqCwUyUhCffTn1=f9pdAip7nsYJMnaPPUuccB8g@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
> I'm also still of the opinion that this shouldn't be done. A zeroed out > null_oid is usually a user bug, where they haven't initialized a `struct > object_id` correctly or ignored the return code while reading a ref.
... unless they are using an element in an object_array and want to selectively have object names to some but not all of the elements in the array. In such a use case, a pointer to a null_oid is just as good a representation as a NULL pointer of "N/A" for a parameter to a function like this one that takes an optional object name. You could force each such callers to notice the entry they are about to call this function with has a null_oid and pass a NULL instead, but why force the caller to do so when the callee is capable of doing so centrally?