summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fsck.c11
-rw-r--r--path.c5
-rw-r--r--read-cache.c8
3 files changed, 19 insertions, 5 deletions
diff --git a/fsck.c b/fsck.c
index b1579c7e28..d80a96f4be 100644
--- a/fsck.c
+++ b/fsck.c
@@ -551,7 +551,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);
@@ -565,6 +565,15 @@ static int fsck_tree(struct tree *item, struct fsck_options *options)
is_hfs_dotgit(name) ||
is_ntfs_dotgit(name));
has_zero_pad |= *(char *)desc.buffer == '0';
+
+ if ((backslash = strchr(name, '\\'))) {
+ while (backslash) {
+ backslash++;
+ has_dotgit |= is_ntfs_dotgit(backslash);
+ 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;
diff --git a/path.c b/path.c
index 22bd0b6f52..f62a37d5f5 100644
--- a/path.c
+++ b/path.c
@@ -1342,10 +1342,7 @@ int is_ntfs_dotgit(const char *name)
if (only_spaces_and_periods(name, len, 5) &&
!strncasecmp(name, "git~1", 5))
return 1;
- if (name[len] != '\\')
- return 0;
- name += len + 1;
- len = -1;
+ return 0;
}
}
diff --git a/read-cache.c b/read-cache.c
index 5b57b369e8..bde1e70c51 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -874,7 +874,15 @@ inside:
if ((c == '.' && !verify_dotfile(path, mode)) ||
is_dir_sep(c) || c == '\0')
return 0;
+ } else if (c == '\\' && protect_ntfs) {
+ if (is_ntfs_dotgit(path))
+ return 0;
+ if (S_ISLNK(mode)) {
+ if (is_ntfs_dotgitmodules(path))
+ return 0;
+ }
}
+
c = *path++;
}
}