summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-07-14 10:03:59 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-07-14 10:03:59 +0000
commit0c4f512bae5b5e67658dd9707430185f1a1f97cc (patch)
tree9267157bfb4ea41b922f6cd7d248c2ec4797efb2 /app/helpers
parent1afdbe320e60aa227dfd75ae1f1f128106660c8a (diff)
parent6bbdce640cc6880a4d3f0c31034e6789b89638d9 (diff)
downloadgitlab-ce-0c4f512bae5b5e67658dd9707430185f1a1f97cc.tar.gz
Merge branch 'find-file-no-longer-inline' into 'master'
Move find file URL out of global variable See merge request !12846
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/projects_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 6a62c7ab0be..26d11f9ab46 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -518,4 +518,12 @@ module ProjectsHelper
current_application_settings.restricted_visibility_levels || []
end
+
+ def find_file_path
+ return unless @project && !@project.empty_repo?
+
+ ref = @ref || @project.repository.root_ref
+
+ project_find_file_path(@project, ref)
+ end
end