move duplicated ref_newer() to remote.c