diffcore-rename.c: move code around to prepare for the next patch