Skip to content
Snippets Groups Projects
Commit 7b62817c authored by Andre Maroneze's avatar Andre Maroneze
Browse files

add git pre-commit hook to prevent mistakes

Consider running 'git config core.hooksPath .githooks' in your OSCS clone
to enable it.
parent 89a9e7d1
No related branches found
No related tags found
1 merge request!27add git pre-commit hook to prevent mistakes
Pipeline #44365 canceled
#!/usr/bin/sh
# Redirect output to stderr.
exec 1>&2
errors=0
for p in $(git ls-files '*/.frama-c/path.mk'); do
if [ ! -L "$p" ]; then
echo "pre-commit error: $p should be a symbolic link"
errors=$((errors+1))
fi
done
if [ $errors -gt 0 ]; then
echo "$errors error(s), aborting commit. Add '--no-verify' to bypass hooks."
exit 1
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment