A simple example repo to demonstrate the bug identified by this StackOverflow post.
Link the hooks with:
./bin/link_hooks.sh
Edit file A and add a line with a newline plus trailing whitespace, like so:
printf "asd \nlklk" >> A
Commit and let the hooks run:
git add A
git commit
You should see this:
<stdin>:8: trailing whitespace.
asd
<stdin>:32: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
Why is this?