]> Kevux Git Server - rit/commit
read-cache: disable renames in add_files_to_cache
authorNick Golden <blindmansion@gmail.com>
Wed, 1 Apr 2026 19:00:33 +0000 (15:00 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Apr 2026 19:45:06 +0000 (12:45 -0700)
commitc0ce43376b178d876bce2073b81737ce49657def
tree50ea30354c34da6c85778f9c78172d34ff970f74
parent67ad42147a7acc2af6074753ebd03d904476118f
read-cache: disable renames in add_files_to_cache

add_files_to_cache() refreshes the index from worktree changes and does
not need rename detection. When unmerged entries and a deleted stage-0
path are present together, rename detection can pair them and rewrite an
unmerged diff pair to point at the deleted path.

That later makes "git commit -a" and "git add -u" try to stat the
deleted path and die with "unable to stat". Disable rename detection in
this callback-driven staging path and add a regression test covering the
crash.

Signed-off-by: Nick Golden <blindmansion@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c
t/t2200-add-update.sh