Magit error \"fatal: ambiguous argument\"

When using magit, I came across errors that looked much like these:

Unpulled commits:
fatal: ambiguous argument 'HEAD..exoplanet/compute_server': unknown revision
or path not in the working tree.
Use '--' to separate paths from revisions

(Here, "exoplanet" is the name of a machine, and "compute_server" the name of a branch.)

The problem turned out to be that .git/config looked like this:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = exoplanet:~/dotfiles-git-master
[branch "compute_server"]
    remote = exoplanet

Note how the branch lists the remote as "exoplanet", but there's no "exoplanet" remote config stanza -- only one called "origin". Changing the remote listed under the branch to be "origin" worked. Here's the working config:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = exoplanet:~/dotfiles-git-master
[branch "compute_server"]
    remote = origin