From dbdb4afb8c7455d5191cdd49280fca2f2519b821 Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Tue, 26 Aug 2014 16:19:29 -0500 Subject: [PATCH] Add a top anchor to the file match regex. --- tools/dev/pre-commit-hook.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/dev/pre-commit-hook.rb b/tools/dev/pre-commit-hook.rb index 930ad69888..514cc75c26 100755 --- a/tools/dev/pre-commit-hook.rb +++ b/tools/dev/pre-commit-hook.rb @@ -50,8 +50,9 @@ end changed_files.each_line do |fname| fname.strip! - next unless File.exist?(fname) and File.file?(fname) - next unless fname =~ /modules.+\.rb/ + next unless File.exist?(fname) + next unless File.file?(fname) + next unless fname =~ /^modules.+\.rb/ files_to_check << fname end