mirror of
https://github.com/golang/go
synced 2024-11-22 23:50:03 -07:00
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 <bradfitz@golang.org>
This commit is contained in:
parent
c2d3e1123c
commit
90fea9d09a
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user