remote: convert get_ref_match to take a struct refspec