diff options
author | Phil Hughes <me@iamphill.com> | 2017-07-13 15:23:55 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-07-13 15:23:55 +0100 |
commit | e578530fa13269526f4243d9109a8fe948a99ae2 (patch) | |
tree | d763c0a8955ed47b2ead514f6edc11ad61352334 /app/helpers | |
parent | 48b976e0973066ebf2f2ffd01b1bb4a7e9d4d040 (diff) | |
download | gitlab-ce-e578530fa13269526f4243d9109a8fe948a99ae2.tar.gz |
Move find file URL out of global variable
Part of #34903
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/projects_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 25969adb649..e1dfed0def3 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 |