2018-11-09 18:39:43 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-03 16:58:33 +00:00
|
|
|
module Gitlab
|
|
|
|
module Git
|
|
|
|
class WikiPageVersion
|
2021-03-05 00:09:24 +00:00
|
|
|
include Gitlab::Utils::StrongMemoize
|
|
|
|
|
2017-10-03 16:58:33 +00:00
|
|
|
attr_reader :commit, :format
|
|
|
|
|
|
|
|
def initialize(commit, format)
|
|
|
|
@commit = commit
|
|
|
|
@format = format
|
|
|
|
end
|
|
|
|
|
2021-01-19 06:10:50 +00:00
|
|
|
delegate :message, :sha, :id, :author_name, :author_email, :authored_date, to: :commit
|
|
|
|
|
2021-03-05 00:09:24 +00:00
|
|
|
def author
|
|
|
|
strong_memoize(:author) do
|
|
|
|
::User.find_by_any_email(author_email)
|
|
|
|
end
|
2021-01-19 06:10:50 +00:00
|
|
|
end
|
2017-10-03 16:58:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|