Re: [PATCH v3 0/3] Remove special casing for PSEUDOREF updates
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 5, 2020, 15:54 UTC
- Message-ID
- <xmqqk0ydozqe.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CAFQ2z_NU4=WcUDvVY9PNs+p-WU4u5=QY+=DHonGyK29numhWoQ@mail.gmail.com>
Han-Wen Nienhuys <hanwen@google.com> writes:
Show 7 quoted lines
>> All of which means FETCH_HEAD is special and we may not want to >> burden the special casing of it to newer backends. > > Can you confirm that FETCH_HEAD is the only thing that can store more > than just a symref / SHA1 ? Based on the name, and a comment in the > JGit source, I thought that MERGE_HEAD might contain more than one > SHA1 at a time.
No I cannot. I do not think MERGE_HEAD is something I added with as deep a thought as I did with FETCH_HEAD. If it mimics FETCH_HEAD, then perhaps it does, but I somehow doubt it.
As can be seen in builtin/merge.c::collect_parents(), we do special case FETCH_HEAD when grabbing what commit*S* to merge, but all others are read with get_merge_parent() that makes a single call to get_oid(), i.e. anything other than FETCH_HEAD cannot have more than one object recorded.