Fix return on git status error

This commit is contained in:
Benjamin Renard 2018-03-20 14:11:00 +01:00
parent 9debafb905
commit 429a960ce0

View file

@ -54,11 +54,16 @@ done
cd $GIT_ROOT
STATUS=$( git status -s )
STATUS=$( git status -s 2>&1 )
res=$?
[ $DEBUG -eq 1 ] && echo -e "Status (return $res): $STATUS"
[ $DEBUG -eq 1 ] && echo -e "Status : $STATUS"
if [ -n "$STATUS" ]
if [ $res -ne 0 ]
then
echo "UNKNOWN : Fail to retreive git status (return code : $res)"
echo -e "$STATUS"
exit 3
elif [ -n "$STATUS" ]
then
echo "WARNING : Git config repo on $( hostname ) not clean"
exit 1