]> git.ipfire.org Git - thirdparty/git.git/blobdiff - tree-walk.c
Sync with 2.20.2
[thirdparty/git.git] / tree-walk.c
index 1e4bbc8a0e48c6afe61dc8aab76488356d7e1cbc..bf6f23397a39385bc500ddbcb6e6bed2709c21e5 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 */