`git_branch_remote_name` would work, but it's horribly expensive, because it enumerates all remotes (which requires a config fetch) for the branch.

The first half of this could use `git_reference_shorthand`, though.