]> git.ipfire.org Git - thirdparty/git.git/blobdiff - tree-walk.c
Sync with 2.23.1
[thirdparty/git.git] / tree-walk.c
index bea819d826fb1c855a7b92dbe2605885c12f5c16..31cec2a08dc6a4490de525c7f31819a98a38e186 100644 (file)
@@ -43,6 +43,12 @@ static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned l
                strbuf_addstr(err, _("empty filename in tree entry"));
                return -1;
        }
+#ifdef GIT_WINDOWS_NATIVE
+       if (protect_ntfs && strchr(path, '\\')) {
+               strbuf_addf(err, _("filename in tree entry contains backslash: '%s'"), path);
+               return -1;
+       }
+#endif
        len = strlen(path) + 1;
 
        /* Initialize the descriptor entry */