]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fsck.c
Sync with 2.16.6
[thirdparty/git.git] / fsck.c
diff --git a/fsck.c b/fsck.c
index 5d9b25fac0aebe677dcde3181d7edb3eff820515..2fc6bbca163194716a80b0ef6b5995b2cabb6fbd 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -566,7 +566,7 @@ static int fsck_tree(struct tree *item, struct fsck_options *options)
 
        while (desc.size) {
                unsigned mode;
-               const char *name;
+               const char *name, *backslash;
                const struct object_id *oid;
 
                oid = tree_entry_extract(&desc, &name, &mode);
@@ -588,6 +588,22 @@ static int fsck_tree(struct tree *item, struct fsck_options *options)
                                                 ".gitmodules is a symbolic link");
                }
 
+               if ((backslash = strchr(name, '\\'))) {
+                       while (backslash) {
+                               backslash++;
+                               has_dotgit |= is_ntfs_dotgit(backslash);
+                               if (is_ntfs_dotgitmodules(backslash)) {
+                                       if (!S_ISLNK(mode))
+                                               oidset_insert(&gitmodules_found, oid);
+                                       else
+                                               retval += report(options, &item->object,
+                                                                FSCK_MSG_GITMODULES_SYMLINK,
+                                                                ".gitmodules is a symbolic link");
+                               }
+                               backslash = strchr(backslash, '\\');
+                       }
+               }
+
                if (update_tree_entry_gently(&desc)) {
                        retval += report(options, &item->object, FSCK_MSG_BAD_TREE, "cannot be parsed as a tree");
                        break;