Merge three separate "fetch refs" functions It really just boils down to one "get_remote_heads()" function, and a common "struct ref" structure definition.