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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 21:08:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 21:08:17 +0300
commit219eead23f9feb5da9ec378c451d773aea2dfe61 (patch)
treeeec14421a05ca8eb79f3cc782abe99532bb6070c /lib/banzai
parent7c38405be9e79099f399aa429503ea7b463bbf5a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/repository_link_filter.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/banzai/filter/repository_link_filter.rb b/lib/banzai/filter/repository_link_filter.rb
index e15201b05cb..24900217560 100644
--- a/lib/banzai/filter/repository_link_filter.rb
+++ b/lib/banzai/filter/repository_link_filter.rb
@@ -131,7 +131,7 @@ module Banzai
path = cleaned_file_path(uri)
nested_path = relative_file_path(uri)
- file_exists?(nested_path) ? nested_path : path
+ path_exists?(nested_path) ? nested_path : path
end
def cleaned_file_path(uri)
@@ -190,12 +190,12 @@ module Banzai
parts.push(path).join('/')
end
- def file_exists?(path)
- path.present? && uri_type(path).present?
+ def path_exists?(path)
+ path.present? && @uri_types[path] != :unknown
end
def uri_type(path)
- @uri_types[path] == :unknown ? "" : @uri_types[path]
+ @uri_types[path] == :unknown ? :blob : @uri_types[path]
end
def current_commit