[client] Fix some bugs in readonly repo support.