refspec: factor out parsing a single refspec