Implement functions related to remote refspec.