summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe <glen@delfi.ee>2016-11-16 02:08:50 +0200
committerSean McGivern <sean@gitlab.com>2016-12-01 11:40:11 +0000
commitd87c4b9c0d3aed4a23d74f340ece2c4bff83101b (patch)
tree8f395ebd82aa62c55849cef5f6b0444f5840edd9
parent5b740fcf2978decca31a459184b16531d7517e35 (diff)
downloadgitlab-shell-d87c4b9c0d3aed4a23d74f340ece2c4bff83101b.tar.gz
use String.end_with? instead of regexp
-rw-r--r--lib/gitlab_custom_hook.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab_custom_hook.rb b/lib/gitlab_custom_hook.rb
index 451d5b4..6265ec1 100644
--- a/lib/gitlab_custom_hook.rb
+++ b/lib/gitlab_custom_hook.rb
@@ -92,7 +92,7 @@ class GitlabCustomHook
# the resulting list is sorted
def match_hook_files(path)
Dir["#{path}/*"].select do |f|
- !f[/~$/] && File.executable?(f)
+ !f.end_with?('~') && File.executable?(f)
end.sort
end
end