2024-02-19 10:18:41 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
2024-02-19 11:25:04 -05:00
|
|
|
if test -n "$SKIP_GIT_HOOK_STAGED_CHECK"
|
|
|
|
then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2024-02-19 10:18:41 -05:00
|
|
|
case $GIT_INDEX_FILE in
|
|
|
|
*.lock)
|
|
|
|
if GIT_INDEX_FILE=${GIT_INDEX_FILE%.lock} git status --porcelain | grep '^M'
|
|
|
|
then
|
|
|
|
echo "Error: Found both staged and unstaged changes when trying to commit with 'git commit -a'."
|
|
|
|
echo "Do two seperate commits with, 'git commit -m ...' and 'git commit -a -m ...'"
|
|
|
|
echo "Or 'git reset .' and then 'git commit -a -m ...' for a single commit"
|
2024-02-19 11:30:55 -05:00
|
|
|
echo "Use SKIP_GIT_HOOK_STAGED_CHECK=Y or --no-verify to skip check"
|
2024-02-19 10:18:41 -05:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|