New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only test the prospective commit: ignore unstaged changes. #1
Conversation
pre-commit
Outdated
@@ -85,5 +88,10 @@ if [ "$CHECK_PHPUNIT" == "1" ] ; then | |||
# PHPUnit will handle the output. | |||
STATUS=1 | |||
fi | |||
cd "$(git rev-parse --show-toplevel)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we'll need to do this before the stash too
I've always been unsure about this PR. Because it is super annoying that unstaged code can affect the checks - so that's wrong. But also I use these githooks on my regular code dev environment and often have unstaged code lying around. |
I completely lost track of this, because I stopped using |
pre-commit
Outdated
@@ -77,6 +80,7 @@ for FILE in $FILES; do | |||
done | |||
|
|||
if [ "$CHECK_PHPUNIT" == "1" ] ; then | |||
ORIGINAL_DIR=`pwd` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems out of scope?
…previously stashed.
0461f87
to
aaff698
Compare
Rewritten solution, based on https://stackoverflow.com/a/34116244 :) |
I reverted this change it was causing issues with my work flow. I kept on getting
Which is more annoying for me than the problem this is solving. We need to file another way |
Prevents e.g. PHPUnit from tripping over
xdebug_break()
statements that you're not even trying to commit.