Skip to content

Commit 1ba0d25

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 d13fce6 + f07171c commit 1ba0d25

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
@@ -451,6 +451,17 @@ int ie_modified(struct index_state *istate,
451451
* then we know it is.
452452
*/
453453
if ((changed & DATA_CHANGED) &&
454+
#ifdef GIT_WINDOWS_NATIVE
455+
/*
456+
* Work around Git for Windows v2.27.0 fixing a bug where symlinks'
457+
* target path lengths were not read at all, and instead recorded
458+
* as 4096: now, all symlinks would appear as modified.
459+
*
460+
* So let's just special-case symlinks with a target path length
461+
* (i.e. `sd_size`) of 4096 and force them to be re-checked.
462+
*/
463+
(!S_ISLNK(st->st_mode) || ce->ce_stat_data.sd_size != MAX_LONG_PATH) &&
464+
#endif
454465
(S_ISGITLINK(ce->ce_mode) || ce->ce_stat_data.sd_size != 0))
455466
return changed;
456467

0 commit comments

Comments
 (0)