diff --git a/oscar/update_gitinfo.bat b/oscar/update_gitinfo.bat index e29fcc31..5675a1a7 100755 --- a/oscar/update_gitinfo.bat +++ b/oscar/update_gitinfo.bat @@ -5,6 +5,7 @@ cd %DIR% if ('git rev-parse --git-dir') ( for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i + if "%GIT_BRANCH"=="HEAD" set GIT_BRANCH="" for /f %%i in ('git rev-parse --short HEAD') do set GIT_REVISION=%%i if ('git diff-index --quiet HEAD --') ( set GIT_REVISION=%GIT_REVISION%-plus diff --git a/oscar/update_gitinfo.sh b/oscar/update_gitinfo.sh index 3bbd4663..699ed78c 100755 --- a/oscar/update_gitinfo.sh +++ b/oscar/update_gitinfo.sh @@ -6,6 +6,7 @@ cd $DIR git rev-parse --git-dir &>/dev/null if [ $? -eq 0 ]; then GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` + [ "$GIT_BRANCH" == "HEAD" ] && GIT_BRANCH="" # not really a branch GIT_REVISION=`git rev-parse --short HEAD` $(git diff-index --quiet HEAD --) if [ $? -ne 0 ]; then