summaryrefslogtreecommitdiff
path: root/pre-commit.d
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-02-18 23:06:05 -0400
committerJoey Hess <joey@kitenet.net>2011-02-18 23:06:05 -0400
commit05a29cb5dd6397c62e42465978b95df074ea5fca (patch)
treed291602745b148f4f7280f740eaa24b4975ef365 /pre-commit.d
parent884ef5ab74b01037fed70b1cdeff2174c47c7d8e (diff)
correct exclude_external regexp to match fully relative paths
git ls-files emits paths with no leading subdirectory. But the regexp still needs to avoid false positives.
Diffstat (limited to 'pre-commit.d')
-rwxr-xr-xpre-commit.d/20warn-problem-files2
1 files changed, 1 insertions, 1 deletions
diff --git a/pre-commit.d/20warn-problem-files b/pre-commit.d/20warn-problem-files
index 3e9e476..e1bbd84 100755
--- a/pre-commit.d/20warn-problem-files
+++ b/pre-commit.d/20warn-problem-files
@@ -2,7 +2,7 @@
set -e
exclude_internal () {
- grep -v '/\(.git\|.hg\|.bzr\|_darcs\)/'
+ egrep -v '(^|/)(.git|.hg|.bzr|_darcs)/'
}
if [ "$VCS" = hg ] || [ "$VCS" = bzr ] || [ "$VCS" = darcs ]; then