summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-20 10:50:26 -0500
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-01-20 10:50:26 -0500
commit7377abf84a7fc20eb93938f73ce77ae26d3ec8ec (patch)
tree709c96668f3398ab261b353481386cb985a7e82c /app
parentf1b4f20c75d0a97c0b1f2efe6366c586a5236094 (diff)
downloadgitlab-ce-7377abf84a7fc20eb93938f73ce77ae26d3ec8ec.tar.gz
Simplifies the HAML if statement for project branch URL
Diffstat (limited to 'app')
-rw-r--r--app/views/layouts/header/_default.html.haml8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml
index d1425cd0e88..fcb6b835a7e 100644
--- a/app/views/layouts/header/_default.html.haml
+++ b/app/views/layouts/header/_default.html.haml
@@ -37,10 +37,6 @@
%h1.title= title
= render 'shared/outdated_browser'
--if @project && !@project.empty_repo? && @ref
+- if @project && !@project.empty_repo?
:javascript
- var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, @ref)}";
-
--elsif @project && !@project.empty_repo?
- :javascript
- var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, @project.repository.root_ref)}"; \ No newline at end of file
+ var findFileURL = "#{namespace_project_find_file_path(@project.namespace, @project, @ref || @project.repository.root_ref)}"; \ No newline at end of file