From e16414e56d8f398f8ddbbde89d3ee833582b8bb2 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Fri, 8 Aug 2014 19:18:32 +0200 Subject: [PATCH] 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 --- tools/appliance/build.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 0d5933f80fb..f29d8bfd370 100755 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -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