Develop a better function for determining the publish branch.

Unfortunately, the code is duplicated (because I want git-missing to be
standalone).  Use the function for git-missing and the prompt.