Created
September 10, 2012 03:59
-
-
Save morimori/3688802 to your computer and use it in GitHub Desktop.
focus タグや save_and_open_page が残っていたらコミットさせない pre-commit フック
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Block commit include focus tag for test | |
git stash --keep-index -q | |
FOCUS_TAGS=$(grep -rn ':focus => true' spec/*/**) | |
result=$? | |
git stash pop -q | |
if [ $result -eq 0 ]; then | |
echo "### PLEASE REMOVE FOCUS TAGS ###" | |
echo "$FOCUS_TAGS" | |
exit 1 | |
fi | |
# Block commit include focus tag for test | |
git stash --keep-index -q | |
SAVE_AND_OPEN_PAGE=$(grep -rn 'save_and_open_page' spec/*/**) | |
result=$? | |
git stash pop -q | |
if [ $result -eq 0 ]; then | |
echo "### PLEASE REMOVE save_and_open_page ###" | |
echo "$SAVE_AND_OPEN_PAGE" | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment