summaryrefslogtreecommitdiff
path: root/app/helpers/gitlab_markdown_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/gitlab_markdown_helper.rb')
-rw-r--r--app/helpers/gitlab_markdown_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index eb68607f050..3b9cd67636d 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -166,13 +166,13 @@ module GitlabMarkdownHelper
def file_exists?(path)
return false if path.nil? || path.empty?
- return @repository.blob_at(current_ref, path).present? || Tree.new(@repository, current_ref, path).entries.any?
+ return @repository.blob_at(current_ref, path).present? || @repository.tree(:head, path).entries.any?
end
# Check if the path is pointing to a directory(tree) or a file(blob)
# eg. doc/api is directory and doc/README.md is file
def local_path(path)
- return "tree" if Tree.new(@repository, current_ref, path).entries.any?
+ return "tree" if @repository.tree(:head, path).entries.any?
return "raw" if @repository.blob_at(current_ref, path).image?
return "blob"
end