Skip to content

Commit f8587c3

Browse files
pks-tgitster
authored andcommitted
fsck: move checks for gitattributes
Move the checks for gitattributes so that they can be extended more readily. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a59a8c6 commit f8587c3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

fsck.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,17 +614,19 @@ static int fsck_tree(const struct object_id *tree_oid,
614614
".gitmodules is a symbolic link");
615615
}
616616

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+
617624
if (S_ISLNK(mode)) {
618625
if (is_hfs_dotgitignore(name) ||
619626
is_ntfs_dotgitignore(name))
620627
retval += report(options, tree_oid, OBJ_TREE,
621628
FSCK_MSG_GITIGNORE_SYMLINK,
622629
".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");
628630
if (is_hfs_dotmailmap(name) ||
629631
is_ntfs_dotmailmap(name))
630632
retval += report(options, tree_oid, OBJ_TREE,

0 commit comments

Comments
 (0)