Check that the only .gitignore file in repository is the ./.gitignore during precommit testing.

This commit is contained in:
Ruben Ayrapetyan
2015-03-26 19:50:31 +03:00
parent 4cf575c40c
commit 3d2374acd5
+12
View File
@@ -24,6 +24,18 @@ BUILD_INFO=`echo -e "$CPPCHECK_INFO\n$VERA_INFO\n$GCC_INFO"`
clear
gitignore_files_list=`find . -name .gitignore`
if [ "$gitignore_files_list" != "./.gitignore" ]
then
echo -e "\n\e[1;33mInvalid .gitignore configuration\e[0m\n"
echo -e -n ".gitignore files list:\t"
echo $gitignore_files_list
echo
exit 1
fi
if [ "`git status --porcelain 2>&1 | wc -l`" != "0" ]
then
echo -e "\n \e[1;90m$GIT_STATUS_NOT_CLEAN_MSG:\n"