From 90fea9d09ac9876147c7223884a09357c3418ed2 Mon Sep 17 00:00:00 2001 From: Derek Shockey Date: Tue, 23 Feb 2016 21:17:25 -0800 Subject: [PATCH] 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 --- misc/git/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.50.0