diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-11-03 23:43:17 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-11-03 23:43:17 +0800 |
commit | 0902ba524f6bfa7f7f6d234378c8847b541d1586 (patch) | |
tree | ab083d9de28f912fed88b5078e97ed0b9b92f096 | |
parent | 1ae557c106e94c20742d0788dc7eb604603faa08 (diff) | |
download | gitlab-ce-0902ba524f6bfa7f7f6d234378c8847b541d1586.tar.gz |
Initialize @statuses in status rather than constructor
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17742312
-rw-r--r-- | app/models/commit.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 1fbda6f6acc..9e7fde9503d 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -57,7 +57,6 @@ class Commit @raw = raw_commit @project = project - @statuses = {} end def id @@ -231,6 +230,8 @@ class Commit end def status(ref = nil) + @statuses ||= {} + if @statuses.key?(ref) @statuses[ref] elsif ref |