Get a list of refs at the remote
The remote (or more exactly its transport) must be connected. The memory belongs to the remote.
The array will stay valid as long as the remote object exists and its transport isn't changed, but a copy is recommended for usage of the data.
the number of remote heads
0 on success, or an error code