fsck: move checks for gitattributes
Move the checks for gitattributes so that they can be extended more readily. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Dec 1, 2022 at 15:46 UTC
f8587c31c96172aac547f83977c98fa8f0e2aa67
1 file changed
+7
-5
fsck.c
+7
-5
@@ -614,17 +614,19 @@ static int fsck_tree(const struct object_id *tree_oid,
614
".gitmodules is a symbolic link");
615
}
616
617
+ if (is_hfs_dotgitattributes(name) || is_ntfs_dotgitattributes(name)) {
618
+ if (S_ISLNK(mode))
619
+ retval += report(options, tree_oid, OBJ_TREE,
620
+ FSCK_MSG_GITATTRIBUTES_SYMLINK,
621
+ ".gitattributes is a symlink");
622
+ }
623
+
624
if (S_ISLNK(mode)) {
625
if (is_hfs_dotgitignore(name) ||
626
is_ntfs_dotgitignore(name))
627
retval += report(options, tree_oid, OBJ_TREE,
628
FSCK_MSG_GITIGNORE_SYMLINK,
629
".gitignore is a symlink");
623
- if (is_hfs_dotgitattributes(name) ||
624
- is_ntfs_dotgitattributes(name))
625
- retval += report(options, tree_oid, OBJ_TREE,
626
- FSCK_MSG_GITATTRIBUTES_SYMLINK,
627
- ".gitattributes is a symlink");
630
if (is_hfs_dotmailmap(name) ||
631
is_ntfs_dotmailmap(name))
632
retval += report(options, tree_oid, OBJ_TREE,