origin/HEAD is not valid; use origin/master for latest when branch == 'master'
Using rev-parse to determine branch name of HEAD for on_branch? method
Merge pull request #106 from mikegerwitz/master

Correctly handle detached head for 'latest' on latest Git versions