From a95a25a2de793fa65017e44e7b22431c37916420 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 27 Nov 2018 09:30:06 +0100 Subject: [PATCH] fixup! mingw: Windows Docker volumes are *not* symbolic links The code in question is unclear, and not everbody has the time to dig up the commit message for the commit that added it, so let's play nice and add an explanation as a code comment. Signed-off-by: Johannes Schindelin --- compat/win32/fscache.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compat/win32/fscache.c b/compat/win32/fscache.c index d1b3c74cde4897..7a3ec6231f9565 100644 --- a/compat/win32/fscache.c +++ b/compat/win32/fscache.c @@ -158,6 +158,15 @@ static struct fsentry *fseentry_create_entry(struct fscache *cache, struct fsent fse = fsentry_alloc(cache, list, buf, len); + /* + * On certain Windows versions, host directories mapped into + * Windows Containers ("Volumes", see https://docs.docker.com/storage/volumes/) + * look like symbolic links, but their targets are paths that + * are valid only in kernel mode. + * + * Let's work around this by detecting that situation and + * telling Git that these are *not* symbolic links. + */ if (fdata->dwReserved0 == IO_REPARSE_TAG_SYMLINK && sizeof(buf) > (list ? list->len + 1 : 0) + fse->len + 1 && is_inside_windows_container()) {