Fixed AOMP_CHECK_GIT_BRANCH. Previous method would fail to build on Red Hat as a   11.5-0-correct-sha-keys
* amd-stg-openmp
aomp-epsdb
aomp11-docs
master
merge-aomp11-to-master
rocmaster
rocmaster-stg did not output the word HEAD when in a detached state.
@@ -260,11 +260,12 @@ function checkrepo(){
if [ "$AOMP_CHECK_GIT_BRANCH" == 1 ] ; then
cd $REPO_DIR
COBRANCH=`git branch --list | grep "\*" | cut -d" " -f2`
+ BRANCH_REGEX="detached"
if [ "$COBRANCH" != "$REPO_BRANCH" ] ; then
if [ "$COBRANCH" == "master" ] ; then
echo "EXIT: Repository $REPO_DIR is on development branch: master"
exit 1
- elif [ "$COBRANCH" == "(HEAD" ] ; then
+ elif [[ "$COBRANCH" =~ $BRANCH_REEGEX ]] ; then
echo "we have an override $REPO_DIR"
else
echo "ERROR: The repository at $REPO_DIR is not on branch $REPO_BRANCH"
