Junio C Hamano [off-list ref] writes:
I noticed that the implementation left next-index crufts almost
every time it was run, and started to clean it up. Here is
still a WIP and it does not optimize the read_tree(HEAD) part,
but you should be able to replace that part with your one-way
merge easily. As I haven't done that ls-files --error-unmatch
equivalent, this does not pass tests that involve partial
commits with added or removed paths.
I was working on this tonight. Will send out a proposed fix
based on this WIP shortly. The result seems to pass all the
tests.