aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-01-23 13:34:36 -0800
committerJunio C Hamano <gitster@pobox.com>2026-01-23 13:34:37 -0800
commit26f50ef98f78f3fb86cd4c94cd85fa09bf1221d0 (patch)
tree22e3a37cd01a08f12ea26eca600fc0d210737435 /read-cache.c
parentf2e92f7b04fb842f02af8e89894351c9f6951af2 (diff)
parent44af34bde7db9430b31a5891c3d1e6d34fefae76 (diff)
downloadgit-26f50ef98f78f3fb86cd4c94cd85fa09bf1221d0.tar.xz
Merge branch 'js/symlink-windows'
Upstream symbolic link support on Windows from Git-for-Windows. * js/symlink-windows: mingw: special-case index entries for symlinks with buggy size mingw: emulate `stat()` a little more faithfully mingw: try to create symlinks without elevated permissions mingw: add support for symlinks to directories mingw: implement basic `symlink()` functionality (file symlinks only) mingw: implement `readlink()` mingw: allow `mingw_chdir()` to change to symlink-resolved directories mingw: support renaming symlinks mingw: handle symlinks to directories in `mingw_unlink()` mingw: add symlink-specific error codes mingw: change default of `core.symlinks` to false mingw: factor out the retry logic mingw: compute the correct size for symlinks in `mingw_lstat()` mingw: teach dirent about symlinks mingw: let `mingw_lstat()` error early upon problems with reparse points mingw: drop the separate `do_lstat()` function mingw: implement `stat()` with symlink support mingw: don't call `GetFileAttributes()` twice in `mingw_lstat()`
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index e9c1b23e48..0c07c3aef7 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -470,6 +470,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_PATH) &&
+#endif
(S_ISGITLINK(ce->ce_mode) || ce->ce_stat_data.sd_size != 0))
return changed;