Skip to content

Commit

Permalink
fixup! mingw: Windows Docker volumes are *not* symbolic links
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Nov 27, 2018
1 parent 7d1b246 commit a95a25a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions compat/win32/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit a95a25a

Please sign in to comment.