Skip to content

Commit

Permalink
Merge pull request #2666 from dscho/nicer-upgrade-path-for-#2637
Browse files Browse the repository at this point in the history
mingw: special-case index entries for symlinks with buggy size
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Jul 7, 2020
2 parents 4bb99e1 + 1ebbf58 commit faaa857
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,17 @@ int ie_modified(struct index_state *istate,
* then we know it is.
*/
if ((changed & DATA_CHANGED) &&
#ifdef GIT_WINDOWS_NATIVE
/*
* Work around Git for Windows v2.27.0 fixing a bug where symlinks'
* target path lengths were not read at all, and instead recorded
* as 4096: now, all symlinks would appear as modified.
*
* So let's just special-case symlinks with a target path length
* (i.e. `sd_size`) of 4096 and force them to be re-checked.
*/
(!S_ISLNK(st->st_mode) || ce->ce_stat_data.sd_size != MAX_LONG_PATH) &&
#endif
(S_ISGITLINK(ce->ce_mode) || ce->ce_stat_data.sd_size != 0))
return changed;

Expand Down

0 comments on commit faaa857

Please sign in to comment.