Merge pull request #3099 from lucas-clemente/fix-focus-detection-in-pre-commit

only run Ginkgo focus detection in staged files in pre-commit hook
This commit is contained in:
Marten Seemann
2021-03-19 18:13:50 +08:00
committed by GitHub

View File

@@ -4,7 +4,7 @@
errored=false
for f in $(git diff --cached --name-only); do
if [[ $f != *_test.go ]]; then continue; fi
output=$(grep -n -e "FIt(" -e "FContext(" -e "FDescribe(" "$f")
output=$(git show :"$f" | grep -n -e "FIt(" -e "FContext(" -e "FDescribe(")
if [ $? -eq 0 ]; then
echo "$f contains a focussed test:"
echo "$output"