summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-08-22 17:19:39 +0100
committerSean McGivern <sean@gitlab.com>2016-08-23 11:01:20 +0100
commit1a7c293c2ddbe960accec355a0ed399de82e0c41 (patch)
tree31534ae5d5694a917cb597c0ed92a096bcf9a348 /app
parentf633f7db66d4ff42abbe764c21f9da4e49045f91 (diff)
downloadgitlab-ce-1a7c293c2ddbe960accec355a0ed399de82e0c41.tar.gz
Fix file links on project page Files viewfix-file-links-on-project-page
Diffstat (limited to 'app')
-rw-r--r--app/controllers/projects_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index fc52cd2f367..2a6385c1029 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -5,7 +5,7 @@ class ProjectsController < Projects::ApplicationController
before_action :project, except: [:new, :create]
before_action :repository, except: [:new, :create]
before_action :assign_ref_vars, only: [:show], if: :repo_exists?
- before_action :tree, only: [:show], if: [:repo_exists?, :project_view_files?]
+ before_action :assign_tree_vars, only: [:show], if: [:repo_exists?, :project_view_files?]
# Authorize
before_action :authorize_admin_project!, only: [:edit, :update, :housekeeping, :download_export, :export, :remove_export, :generate_new_export]
@@ -332,4 +332,11 @@ class ProjectsController < Projects::ApplicationController
def get_id
project.repository.root_ref
end
+
+ # ExtractsPath will set @id = project.path on the show route, but it has to be the
+ # branch name for the tree view to work correctly.
+ def assign_tree_vars
+ @id = get_id
+ tree
+ end
end