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>
maint
Patrick Steinhardt 2022-12-01 15:46:05 +01:00 committed by Junio C Hamano
parent a59a8c687f
commit f8587c31c9
1 changed files with 7 additions and 5 deletions

12
fsck.c
View File

@ -614,17 +614,19 @@ static int fsck_tree(const struct object_id *tree_oid,
".gitmodules is a symbolic link");
}

if (is_hfs_dotgitattributes(name) || is_ntfs_dotgitattributes(name)) {
if (S_ISLNK(mode))
retval += report(options, tree_oid, OBJ_TREE,
FSCK_MSG_GITATTRIBUTES_SYMLINK,
".gitattributes is a symlink");
}

if (S_ISLNK(mode)) {
if (is_hfs_dotgitignore(name) ||
is_ntfs_dotgitignore(name))
retval += report(options, tree_oid, OBJ_TREE,
FSCK_MSG_GITIGNORE_SYMLINK,
".gitignore is a symlink");
if (is_hfs_dotgitattributes(name) ||
is_ntfs_dotgitattributes(name))
retval += report(options, tree_oid, OBJ_TREE,
FSCK_MSG_GITATTRIBUTES_SYMLINK,
".gitattributes is a symlink");
if (is_hfs_dotmailmap(name) ||
is_ntfs_dotmailmap(name))
retval += report(options, tree_oid, OBJ_TREE,