Re: [PATCH 0/1] files-backend: check symref name before update
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 2, 2025, 14:45 UTC
- Message-ID
- <xmqqjz1dxszl.fsf@gitster.g>
- In-Reply-To
- <CAOLa=ZSboPeTNSSh1fsaKc+Ef5DhaKGX+mNiRzyYfvFERa=JLQ@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
> The bigger question for me is if there is an instance that you'd want to > modify the HEAD file manually. Or is there a way this can be done via > any of the existing Git commands. Otherwise, I'm not sure I would call > this a bug.
As we discussed downthread, I tend to agree with you here that this is a corrupt repository leading the tool to do a nonsensical thing, and the true bug here is that "fsck" is not catching it. But I do not mind if we add a check at runtime, probably at the location the patch under discussion identified, that makes sure a symbolic ref points at a valid target the same way "git fsck" does.
Thanks.