diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index 4c6fae23d..60948ce55 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -115,7 +115,7 @@ class Repository::Mercurial < Repository AND (#{Change.table_name}.path = ? OR #{Change.table_name}.path LIKE ? ESCAPE ?))" args << path.with_leading_slash - args << "#{path.with_leading_slash.gsub(/[%_\\]/) { |s| "\\#{s}" }}/%" << '\\' + args << "#{path.with_leading_slash.gsub(%r{[%_\\]}) { |s| "\\#{s}" }}/%" << '\\' end [cond.join(' AND '), *args] unless cond.empty?