diff --git a/check_git_config b/check_git_config index 40d83f6..43e51e5 100755 --- a/check_git_config +++ b/check_git_config @@ -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