Initialize @statuses in status rather than constructor

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17742312
This commit is contained in:
Lin Jen-Shin 2016-11-03 23:43:17 +08:00
parent 1ae557c106
commit 0902ba524f

View file

@ -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