diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-08-23 20:50:54 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-08-23 20:50:54 +0000 |
commit | aa6fe141b3052036d9d55681f81a8c290e262990 (patch) | |
tree | 214d17969ab8262adf510af546eeb41ea48f369e /app | |
parent | 739620fe98aa0260fbc1f0ea4e98609019b1a665 (diff) | |
parent | 1a7c293c2ddbe960accec355a0ed399de82e0c41 (diff) | |
download | gitlab-ce-aa6fe141b3052036d9d55681f81a8c290e262990.tar.gz |
Merge branch 'fix-file-links-on-project-page' into 'master'
Fix file links on project page Files view
## What does this MR do?
Fix the project show page when the default view is set to Files so that the links work.
## Are there points in the code the reviewer needs to double check?
I can't figure out what caused this to break :confused:
## What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-com/support-forum/issues/959.
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) (N/A)
- [x] API support added (N/A)
- Tests
- [x] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5933
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects_controller.rb | 9 |
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 |