Avoid instantiation of a Git::Tree
What does this MR do?
Avoid a git operation when doesn't needed
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added [ ] Documentation created/updated[ ] API support added- Tests
[ ] Added for this feature/bug-
All builds are passing
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together
Merge request reports
Activity
Reassigned to @yorickpeterse
303 304 project.repository_exists? && !project.empty_repo? 304 305 end 305 306 307 def project_view_files? 308 current_user && current_user.project_view == 'files' The tree is only needed for the _files project view, the default
project_view
for users or users aren't logged in isreadme
which shows the readme and doesn't need the tree instance variable.- So if there is no current user, we'll show the readme page (no need a tree).
- If the current user has as project view
readme
we'll show the readme page (no need a tree). - If the current user has as project view
files
we'll need the tree so we need to load it.
Yes
project_view
means to figure out which template/tab to use so at controller level we need to now the template to decide if we need to execute that or not.
Reassigned to @pacoguzman
Reassigned to @yorickpeterse
Milestone changed to %8.10
mentioned in commit a647d557
mentioned in merge request !5317 (merged)
mentioned in commit 017ae313
mentioned in commit 9a631d31
mentioned in merge request gitlab-com/www-gitlab-com!2497 (merged)
Mentioned in commit ubudzisz/gitlab-ce@017ae313
Mentioned in commit pfjason/gitlab-ce@9a631d31
Mentioned in commit stanhu/gitlab-ce@a647d557