Skip to content

Commit 65bbe70

Browse files
dschodrizzd
authored andcommitted
fscache: remember the reparse tag for each entry
We will use this in the next commit to implement an FSCache-aware version of is_mount_point(). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 5df633c commit 65bbe70

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compat/win32/fscache.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);
4141
struct fsentry {
4242
struct hashmap_entry ent;
4343
mode_t st_mode;
44+
ULONG reparse_tag;
4445
/* Length of name. */
4546
unsigned short len;
4647
/*
@@ -180,6 +181,10 @@ static struct fsentry *fseentry_create_entry(struct fscache *cache, struct fsent
180181

181182
fse = fsentry_alloc(cache, list, buf, len);
182183

184+
fse->reparse_tag =
185+
fdata->FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT ?
186+
fdata->EaSize : 0;
187+
183188
/*
184189
* On certain Windows versions, host directories mapped into
185190
* Windows Containers ("Volumes", see https://docs.docker.com/storage/volumes/)
@@ -189,8 +194,7 @@ static struct fsentry *fseentry_create_entry(struct fscache *cache, struct fsent
189194
* Let's work around this by detecting that situation and
190195
* telling Git that these are *not* symbolic links.
191196
*/
192-
if (fdata->FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT &&
193-
fdata->EaSize == IO_REPARSE_TAG_SYMLINK &&
197+
if (fse->reparse_tag == IO_REPARSE_TAG_SYMLINK &&
194198
sizeof(buf) > (list ? list->len + 1 : 0) + fse->len + 1 &&
195199
is_inside_windows_container()) {
196200
size_t off = 0;

0 commit comments

Comments
 (0)