appliance: use the right way to get git branch name

Taken from Junio C Hamano's blog [1], git's maintainer, he must not be wrong :)

[1] http://git-blame.blogspot.ch/2013/06/checking-current-branch-programatically.html

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit e16414e56d)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2014-08-08 19:18:32 +02:00
parent d33278250d
commit ffe0f2f60f
1 changed files with 1 additions and 4 deletions

View File

@ -31,12 +31,9 @@ build_date=`date +%Y-%m-%d`
branch=
if [ -z "$branch" ] ; then
branch=$(git rev-parse --abbrev-ref HEAD)
branch=`git symbolic-ref --short -q HEAD 2>/dev/null || echo unknown`
fi
if [ -z "$branch" ] ; then
branch=unknown
fi
rootdir=$PWD
# Initialize veewee and dependencies