From: Derek Shockey Date: Wed, 24 Feb 2016 05:17:25 +0000 (-0800) Subject: misc/git: Fix non-literal period in pre-commit grep X-Git-Tag: go1.7beta1~1693 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=90fea9d09ac9876147c7223884a09357c3418ed2;p=gostls13.git misc/git: Fix non-literal period in pre-commit grep Looks like this was intended to match a literal period to restrict this to `.go` files, but in POSIX grep, the unescaped period matches any character. Change-Id: I20e00323baa9e9631792eff5035966297665bbee Reviewed-on: https://go-review.googlesource.com/19880 Reviewed-by: Brad Fitzpatrick --- diff --git a/misc/git/pre-commit b/misc/git/pre-commit index 18b7f832f3..242159f04a 100755 --- a/misc/git/pre-commit +++ b/misc/git/pre-commit @@ -10,7 +10,7 @@ # # This script does not handle file names that contain spaces. -gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '.go$') +gofiles=$(git diff --cached --name-only --diff-filter=ACM | grep '\.go$') [ -z "$gofiles" ] && exit 0 unformatted=$(gofmt -l $gofiles)