Re: [PATCH 1/7] sequencer: clean up pseudo refs with REF_NO_DEREF
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 19, 2024, 19:14 UTC
- Message-ID
- <xmqqttn9jfta.fsf@gitster.g>
- In-Reply-To
- <48b95fe954c1dbdd080ce7a0cc871f4850bddeae.1705659748.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 6 quoted lines
> When cleaning up the state-tracking pseudorefs CHERRY_PICK_HEAD or > REVERT_HEAD we do not set REF_NO_DEREF. In the unlikely case where those > refs are a symref we would thus end up deleting the symref targets, and > not the symrefs themselves. > > Harden the code to use REF_NO_DEREF to fix this.
This level of attention to detail is very much appreciated. I suspect that this was inspired by the other topic we discussed the other day to tighten accesses to {MERGE,CHERRY_PICK,REVERT}_HEAD that is done via repo_get_oid() to the one based on read_ref_full()?