git/refs
shejialuo 1c31be45b3 fsck: add ref name check for files backend
The git-fsck(1) only implicitly checks the reference, it does not fully
check refs with bad format name such as standalone "@".

However, a file ending with ".lock" should not be marked as having a bad
ref name. It is expected that concurrent writers may have such lock files.
We currently ignore this situation. But for bare ".lock" file, we will
report it as error.

In order to provide such checks, add a new fsck message id "badRefName"
with default ERROR type. Use existing "check_refname_format" to explicit
check the ref name. And add a new unit test to verify the functionality.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-08 09:36:53 -07:00
..
debug.c refs: set up ref consistency check infrastructure 2024-08-08 09:36:53 -07:00
files-backend.c fsck: add ref name check for files backend 2024-08-08 09:36:53 -07:00
iterator.c refs: convert iteration over replace refs to accept ref store 2024-05-17 10:33:38 -07:00
packed-backend.c refs: set up ref consistency check infrastructure 2024-08-08 09:36:53 -07:00
packed-backend.h refs: adjust names for `init` and `init_db` callbacks 2024-05-17 10:33:36 -07:00
ref-cache.c refs/files: fix NULL pointer deref when releasing ref store 2024-06-06 09:04:32 -07:00
ref-cache.h hash-ll: merge with "hash.h" 2024-06-14 10:26:33 -07:00
refs-internal.h refs: set up ref consistency check infrastructure 2024-08-08 09:36:53 -07:00
reftable-backend.c refs: set up ref consistency check infrastructure 2024-08-08 09:36:53 -07:00