branch: factor out "upstream is not a branch" error messages