From 1c31be45b3b263670c7d2a91c27cc119b77dd2e2 Mon Sep 17 00:00:00 2001 From: shejialuo Date: Thu, 8 Aug 2024 19:31:42 +0800 Subject: 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 Mentored-by: Karthik Nayak Signed-off-by: shejialuo Signed-off-by: Junio C Hamano --- Documentation/fsck-msgids.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Documentation/fsck-msgids.txt') diff --git a/Documentation/fsck-msgids.txt b/Documentation/fsck-msgids.txt index 7c809fddf1..68a2801f15 100644 --- a/Documentation/fsck-msgids.txt +++ b/Documentation/fsck-msgids.txt @@ -22,6 +22,9 @@ `badRefFiletype`:: (ERROR) A ref has a bad file type. +`badRefName`:: + (ERROR) A ref has an invalid format. + `badTagName`:: (INFO) A tag has an invalid format. -- cgit v1.2.3