"Elijah Newren via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > git diff-index --cached --name-only --diff-filter=A $CTREE >"$a" > git read-tree --reset $CTREE > git update-index --add --stdin <"$a" > rm -f "$a" This is orthogonal to what this patch does, as this is supposed to be just bug-for-bug compatible rewrite. But I wonder if the above sequence, whether it is done as a series of plumbing invocations or subroutine calls, is a relic dating back in the days before i-t-a existed. If we want to revert the changes to the index for working tree files for removed or modified ones, I do not offhand see a good reason why we would want to keep the contents to new paths---if i-t-a were available when the sequence was designed, I suspect we would just have added the path as i-t-a in order to keep track of the presence of the path but not necessarily the contents in it.