Skip to content

Commit a27e5b9

Browse files
dschoGit for Windows Build Agent
authored andcommitted
Merge pull request #2666 from dscho/nicer-upgrade-path-for-#2637
mingw: special-case index entries for symlinks with buggy size
2 parents b4eaeff + d066715 commit a27e5b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

read-cache.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,17 @@ int ie_modified(struct index_state *istate,
453453
* then we know it is.
454454
*/
455455
if ((changed & DATA_CHANGED) &&
456+
#ifdef GIT_WINDOWS_NATIVE
457+
/*
458+
* Work around Git for Windows v2.27.0 fixing a bug where symlinks'
459+
* target path lengths were not read at all, and instead recorded
460+
* as 4096: now, all symlinks would appear as modified.
461+
*
462+
* So let's just special-case symlinks with a target path length
463+
* (i.e. `sd_size`) of 4096 and force them to be re-checked.
464+
*/
465+
(!S_ISLNK(st->st_mode) || ce->ce_stat_data.sd_size != MAX_LONG_PATH) &&
466+
#endif
456467
(S_ISGITLINK(ce->ce_mode) || ce->ce_stat_data.sd_size != 0))
457468
return changed;
458469

0 commit comments

Comments
 (0)