get current branch: use advice from http://git-blame.blogspot.fr/2013/06/checking-current-branch-programatically.html