(in this case, throw away all local modifications; I'll start patching from scratch)
Patches provided by Joel Baker in PR 22253, verified by myself.