I figured out what was causing that:
I had created my pre-commit hook in git core directory, but the git had created a pre-commit hook in project’s .git/hooks/ directory. I just removed it.
It means running the command that @romin21 mentioned inside project’s root directory:
rm -rf .git/hooks