refs: add repository argument to for_each_replace_ref