git: Add support for detached head state
git: check the correct remote branch for has_commit

Previously it was always checking against origin/$branch, but the
remote branch can have any name and the remote branch can also have
any name.
Merge branch 'fix-git-integration' of https://github.com/jonasb/liquidprompt into develop