Fix return on git status error
This commit is contained in:
parent
9debafb905
commit
429a960ce0
1 changed files with 9 additions and 4 deletions
|
@ -54,11 +54,16 @@ done
|
||||||
|
|
||||||
cd $GIT_ROOT
|
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 [ $res -ne 0 ]
|
||||||
|
then
|
||||||
if [ -n "$STATUS" ]
|
echo "UNKNOWN : Fail to retreive git status (return code : $res)"
|
||||||
|
echo -e "$STATUS"
|
||||||
|
exit 3
|
||||||
|
elif [ -n "$STATUS" ]
|
||||||
then
|
then
|
||||||
echo "WARNING : Git config repo on $( hostname ) not clean"
|
echo "WARNING : Git config repo on $( hostname ) not clean"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue