Change the command to get the current branch name for git.
"git sumbolic-ref" also provides a valid branch name when the
repository is empty. In detached HEAD state it has an empty
output, which is exactly what we did before manually. However,
in that case it also returns with a non-zero exit code which
we need to ignore.
REVIEW: 115121