Use plumbing rev-parse to get the branch name
Use plumbing rev-parse to get the branch name

Git plumbing command rev-parse is able to return the current branch
symbolic name in a machine readable manner and will return the rev
inputted (HEAD in this case) if no corresponding branch can be found
(detached HEAD).

This works on all versions of git since 1.6.3 and alternatively can be
replaced with 'git symbolic-ref --short -q HEAD' on versions 1.7.10 and
newer.

Change-Id: I486dcad4b73f9f06d7196e6888a4da79c7d574ad

entropia1/git-review,ka2m/git-review,openstack-infra/git-review