remote: add test to retrieve the advertised references from a local repository and fix related implementation