Subject: Re: [PATCH 0/1] files-backend: check symref name before update

From: Junio C Hamano <[email-masked]>
Date: Thu, 02 Oct 2025 07:45:18 -0700

Karthik Nayak <[email-masked]> 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.