git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v=2 0/1] files-backend: check symref name before update
@ 2025-10-04 14:42 Han Young
  2025-10-04 14:42 ` [PATCH v=2 1/1] " Han Young
  0 siblings, 1 reply; 5+ messages in thread
From: Han Young @ 2025-10-04 14:42 UTC (permalink / raw)
  To: git; +Cc: karthik.188, gitster, ps, Han Young

From: Han Young <hanyoung@protonmail.com>

Following the discussing, I looked into the refs verify and fsck
commands. The refs verify command does not check the HEAD ref,
fsck checks the HEAD ref name and the commit object it points to.

I think we can move the fsck_head_link from fsck to refs. Then both
git fsck and git refs verify can use the same function to check the HEAD
ref.

However, there's no harm in adding a runtime check. 'git reset foo' will
happily create a ref file outside refs/ and return without error on an
invalid HEAD ref.

Change from v1:
* add a test in t7102-reset

Han Young (1):
  files-backend: check symref name before update

 refs/files-backend.c | 10 ++++++++++
 t/t7102-reset.sh     |  8 ++++++++
 2 files changed, 18 insertions(+)

-- 
2.51.0.373.g2c26b26d9


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-10-06 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-04 14:42 [PATCH v=2 0/1] files-backend: check symref name before update Han Young
2025-10-04 14:42 ` [PATCH v=2 1/1] " Han Young
2025-10-05 21:53   ` Junio C Hamano
2025-10-06  0:46     ` Jeff King
2025-10-06 15:52       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).