Skip to content
Snippets Groups Projects

Avoid instantiation of a Git::Tree

Merged Paco Guzman requested to merge avoid-instantiate-tree-for-projects-show-readme-view into master

What does this MR do?

Avoid a git operation when doesn't needed

Does this MR meet the acceptance criteria?

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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'
  • What will happen here if the user isn't logged in? Also, isn't project_view meant for the dashboard to figure out what tab should be displayed by default?

  • Author Contributor

    The tree is only needed for the _files project view, the default project_viewfor users or users aren't logged in is readme 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

  • Yorick Peterse Milestone changed to %8.10

    Milestone changed to %8.10

  • Yorick Peterse Added ~18308 label

    Added ~18308 label

  • Yorick Peterse Status changed to merged

    Status changed to merged

  • Yorick Peterse mentioned in commit a647d557

    mentioned in commit a647d557

  • Sean McGivern mentioned in merge request !5317 (merged)

    mentioned in merge request !5317 (merged)

  • Rémy Coutable mentioned in commit 017ae313

    mentioned in commit 017ae313

  • Rémy Coutable mentioned in commit 9a631d31

    mentioned in commit 9a631d31

  • Please register or sign in to reply
    Loading