diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-21 12:36:41 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-21 12:36:41 +0300 |
commit | de0acf3cf7f27e7a4f32dc8cad6293f823eda300 (patch) | |
tree | 4f5810004fd2f23d5491116ca4f919efea88ee88 /lib/gitlab | |
parent | 9c2214f202e98d0427d86a57888574327a6607dd (diff) | |
parent | d25b50fda63e830cb2c87281bba064b71185e712 (diff) |
Merge branch 'master' into reference-pipeline-and-caching
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/backend/grack_auth.rb | 9 | ||||
-rw-r--r-- | lib/gitlab/incoming_email.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/markdown/reference_filter.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/reference_extractor.rb | 2 |
4 files changed, 15 insertions, 8 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb index 0353b3b7ed3..6830a916bcb 100644 --- a/lib/gitlab/backend/grack_auth.rb +++ b/lib/gitlab/backend/grack_auth.rb @@ -193,7 +193,14 @@ module Grack end def render_grack_auth_ok - [200, { "Content-Type" => "application/json" }, [JSON.dump({ 'GL_ID' => Gitlab::ShellEnv.gl_id(@user) })]] + [ + 200, + { "Content-Type" => "application/json" }, + [JSON.dump({ + 'GL_ID' => Gitlab::ShellEnv.gl_id(@user), + 'RepoPath' => project.repository.path_to_repo, + })] + ] end def render_not_found diff --git a/lib/gitlab/incoming_email.rb b/lib/gitlab/incoming_email.rb index 856ccc71084..9068d79c95e 100644 --- a/lib/gitlab/incoming_email.rb +++ b/lib/gitlab/incoming_email.rb @@ -24,12 +24,12 @@ module Gitlab match[1] end - private - def config Gitlab.config.incoming_email end + private + def address_regex wildcard_address = config.address return nil unless wildcard_address diff --git a/lib/gitlab/markdown/reference_filter.rb b/lib/gitlab/markdown/reference_filter.rb index adaca78ba27..a4c560f578c 100644 --- a/lib/gitlab/markdown/reference_filter.rb +++ b/lib/gitlab/markdown/reference_filter.rb @@ -15,7 +15,7 @@ module Gitlab LazyReference = Struct.new(:klass, :ids) do def self.load(refs) lazy_references, values = refs.partition { |ref| ref.is_a?(self) } - + lazy_values = lazy_references.group_by(&:klass).flat_map do |klass, refs| ids = refs.flat_map(&:ids) klass.where(id: ids) @@ -107,10 +107,10 @@ module Gitlab return doc if project.nil? search_text_nodes(doc).each do |node| - content = node.to_html - - next unless content.match(pattern) next if ignored_ancestry?(node) + next unless node.text =~ pattern + + content = node.to_html html = yield content diff --git a/lib/gitlab/reference_extractor.rb b/lib/gitlab/reference_extractor.rb index 37141efb4c3..69c7a0f4779 100644 --- a/lib/gitlab/reference_extractor.rb +++ b/lib/gitlab/reference_extractor.rb @@ -28,7 +28,7 @@ module Gitlab def references @references ||= Hash.new do |references, type| type = type.to_sym - return references[type] if references.has_key?(type) + next references[type] if references.has_key?(type) references[type] = pipeline_result(type) end |