summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 0674428..aa427c5 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -959,11 +959,14 @@ static int verify_dotfile(const char *rest, unsigned mode)
int verify_path(const char *path, unsigned mode)
{
- char c;
+ char c = 0;
if (has_dos_drive_prefix(path))
return 0;
+ if (!is_valid_path(path))
+ return 0;
+
goto inside;
for (;;) {
if (!c)
@@ -971,6 +974,7 @@ int verify_path(const char *path, unsigned mode)
if (is_dir_sep(c)) {
inside:
if (protect_hfs) {
+
if (is_hfs_dotgit(path))
return 0;
if (S_ISLNK(mode)) {
@@ -979,6 +983,10 @@ inside:
}
}
if (protect_ntfs) {
+#ifdef GIT_WINDOWS_NATIVE
+ if (c == '\\')
+ return 0;
+#endif
if (is_ntfs_dotgit(path))
return 0;
if (S_ISLNK(mode)) {
@@ -991,7 +999,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++;
}
}