Re: [PATCH v2 5/7] update-ref: add support for symref-create
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Apr 21, 2024, 15:57 UTC
- Message-ID
- <CAOLa=ZRcXteRGQa82aw+WxfxsufrU2R-6hr7XYu9-SqjtbaS6Q@mail.gmail.com>
- In-Reply-To
- <CAOLa=ZSvx4bOmJY+P5j3fJTqfjY37teMHQhOYDjTM4oJtnv_qw@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.
[snip]
Show 14 quoted lines
>>> + /* for dangling symrefs we gracefully set the oid to zero */
>>> + if (!refs_resolve_ref_unsafe(&refs->base, update->new_ref,
>>> + RESOLVE_REF_READING, &update->new_oid, NULL)) {
>>> + update->new_oid = *null_oid();
>>> + }
>>
>> Can this actually happenn right now? I thought that the `read_ref()`
>> further up forbids this case.
>>
>> Patrick
>
> With update-ref, it won't happen anymore, because as you mentioned, we
> use `read_ref()`. I thought it was still worthwhile to have. But I guess
> its cleaner to remove this.Well, just realized that this needs to stay because we also want the resolved OID for the reflogs. Will modify the comment though.