diff options
author | Robert Speicher <robert@gitlab.com> | 2016-03-21 14:42:25 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-03-21 14:42:25 +0000 |
commit | ffc3acd498e5cfeb98f6104421cba32acdd7ee64 (patch) | |
tree | 7127c4a4b0221703dce53948d8de48bb2dd152bc /app/models/issue.rb | |
parent | 3fca30d27f90a52bdbca746b1244c95e6c7db2d2 (diff) | |
parent | 75aaf91cb1d08c4350e2881b18118faf30e1f310 (diff) | |
download | gitlab-ce-ffc3acd498e5cfeb98f6104421cba32acdd7ee64.tar.gz |
Merge branch 'issues-show-performance' into 'master'
Improve performance of viewing individual issues
This MR does two things:
1. `Issue#related_branches` no longer performs Git operations that aren't needed
2. The output of `Repository#exists?` is now cached and flushed properly
Combined these two changes should further cut down the amount of Git operations performed when viewing individual issues (and possibly other pages).
See merge request !3296
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 35e08fa915b..ddb51ad5775 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -108,9 +108,9 @@ class Issue < ActiveRecord::Base end def related_branches - return [] if self.project.empty_repo? - - self.project.repository.branch_names.select { |branch| branch.end_with?("-#{iid}") } + project.repository.branch_names.select do |branch| + branch.end_with?("-#{iid}") + end end # Reset issue events cache |