remote.c: avoid O(m*n) behavior in match_push_refs