Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-17 10:20:52 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-10-17 10:20:52 +0300
commit09a7da7222d535948eadcf53c821360b037f7f6b (patch)
tree15d0844efcb97db1eeb5cac5b42b54ca6b4d4bac /lib
parent43973223af6755c8213e639e616bc788d7c0493c (diff)
parentcb8654e85650ba6107031cc978d882f4b2f272cf (diff)
Merge remote-tracking branch 'upstream/master' into pipeline-emails
* upstream/master: (148 commits) Fix broken rspec in compare text Added logic to handle a revision input that does not exist in the menu Fix broken Spinach tests caused by changes in !6550 Convert CHANGELOG to Markdown Fix active tab test for branches page Fix merge requests feature tests Wait for ajax call in merge request unsubscribe test Fix 500 error when creating mileston from group page Fix 404 when group path has dot in the name Add the tech writers usernames in the doc_sytleguide doc Fix broken SCSS linter errors due to missing newlines Fix Hash syntax to work for both Ruby 2.1 and 2.3 Fix Spinach merge request diff failures remove ashley since she no longer works here Revert "Improve tabbing usability for sign in page" Don't use member properties in users_spec, and remove loading ref. Clean up stray Sign up ref. Back off the array spreading, bc poltergeist freaks out. Convert dispatcher to es6. Add exists to users routes and fix endpoint. ...
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/renderer.rb4
-rw-r--r--lib/extracts_path.rb17
2 files changed, 10 insertions, 11 deletions
diff --git a/lib/banzai/renderer.rb b/lib/banzai/renderer.rb
index 6924a293da8..ce048a36fa0 100644
--- a/lib/banzai/renderer.rb
+++ b/lib/banzai/renderer.rb
@@ -1,6 +1,6 @@
module Banzai
module Renderer
- extend self
+ module_function
# Convert a Markdown String into an HTML-safe String of HTML
#
@@ -141,8 +141,6 @@ module Banzai
end.html_safe
end
- private
-
def cacheless_render(text, context = {})
Gitlab::Metrics.measure(:banzai_cacheless_render) do
result = render_result(text, context)
diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb
index e4d996a3fb6..9b74364849e 100644
--- a/lib/extracts_path.rb
+++ b/lib/extracts_path.rb
@@ -113,17 +113,18 @@ module ExtractsPath
@id = get_id
@ref, @path = extract_ref(@id)
@repo = @project.repository
- if @options[:extended_sha1].blank?
- @commit = @repo.commit(@ref)
- else
- @commit = @repo.commit(@options[:extended_sha1])
- end
- if @path.empty? && !@commit
- @id = @ref = extract_ref_without_atom(@id)
+ if @options[:extended_sha1].present?
+ @commit = @repo.commit(@options[:extended_sha1])
+ else
@commit = @repo.commit(@ref)
- request.format = :atom if @commit
+ if @path.empty? && !@commit && @id.ends_with?('.atom')
+ @id = @ref = extract_ref_without_atom(@id)
+ @commit = @repo.commit(@ref)
+
+ request.format = :atom if @commit
+ end
end
raise InvalidPathError unless @commit