Skip to content

Commit

Permalink
Merge pull request #3099 from lucas-clemente/fix-focus-detection-in-p…
Browse files Browse the repository at this point in the history
…re-commit

only run Ginkgo focus detection in staged files in pre-commit hook
  • Loading branch information
marten-seemann authored Mar 19, 2021
2 parents 28ba9c4 + 64f015f commit 749bbe4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 749bbe4

Please sign in to comment.