read-cache.c: move index_has_changes() from merge.c