Skip to content

Commit c545663

Browse files
committed
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 <[email protected]>
1 parent 3707e4c commit c545663

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compat/win32/fscache.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ static struct fsentry *fseentry_create_entry(struct fscache *cache, struct fsent
158158

159159
fse = fsentry_alloc(cache, list, buf, len);
160160

161+
/*
162+
* On certain Windows versions, host directories mapped into
163+
* Windows Containers ("Volumes", see https://docs.docker.com/storage/volumes/)
164+
* look like symbolic links, but their targets are paths that
165+
* are valid only in kernel mode.
166+
*
167+
* Let's work around this by detecting that situation and
168+
* telling Git that these are *not* symbolic links.
169+
*/
161170
if (fdata->dwReserved0 == IO_REPARSE_TAG_SYMLINK &&
162171
sizeof(buf) > (list ? list->len + 1 : 0) + fse->len + 1 &&
163172
is_inside_windows_container()) {

0 commit comments

Comments
 (0)