Use a more robust command for getting the branch name

The previous way had stopped working for me, causing an empty issue
number to be sent to GitHub, which 500'ed. Maybe it was because of a new git
version.