gluegen: directly use git subcommands rather than sed over a temp file

git symbolic-ref is the preferred way (as of 1.7.10) to parse the current branch
name.  This even works for the detached head case.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Merge remote-tracking branch 'hharrison/master'