From: Patrick Steinhardt Date: Thu, 1 Dec 2022 14:46:05 +0000 (+0100) Subject: fsck: move checks for gitattributes X-Git-Tag: v2.39.1~1^2~1^2~1^2~1^2~1^2~1^2~1^2~1^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8587c31c96172aac547f83977c98fa8f0e2aa67;p=thirdparty%2Fgit.git fsck: move checks for gitattributes Move the checks for gitattributes so that they can be extended more readily. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- diff --git a/fsck.c b/fsck.c index 4762ca9478..3a7fb9ebba 100644 --- a/fsck.c +++ b/fsck.c @@ -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,