fsck: simplify ".git" check
There's no need for us to manually check for ".git"; it's a subset of the other filesystem-specific tests. Dropping it makes our code slightly shorter. More importantly, the existing code may make a reader wonder why ".GIT" is not covered here, and whether that is a bug (it isn't, as it's also covered in the filesystem-specific tests). Signed-off-by: Jeff King <peff@peff.net>
Jeff King committed
May 13, 2018 at 12:35 UTC
ed9c3220621d634d543bc4dd998d12167dfc57d4
1 file changed
+1
-3
fsck.c
+1
-3
@@ -561,9 +561,7 @@ static int fsck_tree(struct tree *item, struct fsck_options *options)
561
has_empty_name |= !*name;
562
has_dot |= !strcmp(name, ".");
563
has_dotdot |= !strcmp(name, "..");
564
- has_dotgit |= (!strcmp(name, ".git") ||
565
- is_hfs_dotgit(name) ||
566
- is_ntfs_dotgit(name));
564
+ has_dotgit |= is_hfs_dotgit(name) || is_ntfs_dotgit(name);
565
has_zero_pad |= *(char *)desc.buffer == '0';
566
if (update_tree_entry_gently(&desc)) {
567
retval += report(options, &item->object, FSCK_MSG_BAD_TREE, "cannot be parsed as a tree");