git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v=2 0/1] files-backend: check symref name before update

From
Han Young <hanyang.tony@bytedance.com>
Date
Oct 4, 2025, 14:42 UTC
Message-ID
<20251004144223.23436-1-hanyang.tony@bytedance.com>
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
Next: Han Young
Message 1 of 5 in “files-backend: check symref name before update”
  1. 0/1 files-backend: check symref name before updateHan Young, Oct 4, 2025
  2. 1/1 files-backend: check symref name before updateHan Young, Oct 4, 2025
  3. Junio C HamanoOct 5, 2025
  4. Jeff KingOct 6, 2025
  5. Junio C HamanoOct 6, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.