2011-11-20 21:32:12 +01:00
|
|
|
class Commit
|
2011-11-28 10:46:41 +01:00
|
|
|
include Utils::CharEncode
|
|
|
|
|
2011-11-27 16:35:49 +01:00
|
|
|
attr_accessor :commit
|
|
|
|
attr_accessor :head
|
|
|
|
|
|
|
|
delegate :message,
|
|
|
|
:committed_date,
|
|
|
|
:parents,
|
|
|
|
:sha,
|
|
|
|
:date,
|
|
|
|
:author,
|
|
|
|
:message,
|
|
|
|
:diffs,
|
|
|
|
:tree,
|
|
|
|
:id,
|
|
|
|
:to => :commit
|
|
|
|
|
|
|
|
def initialize(raw_commit, head = nil)
|
|
|
|
@commit = raw_commit
|
|
|
|
@head = head
|
|
|
|
end
|
|
|
|
|
|
|
|
def safe_message
|
2011-11-28 10:46:41 +01:00
|
|
|
encode(message)
|
2011-11-27 16:35:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def created_at
|
|
|
|
committed_date
|
|
|
|
end
|
|
|
|
|
|
|
|
def author_email
|
2011-11-28 10:46:41 +01:00
|
|
|
encode(author.email)
|
2011-11-27 16:35:49 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def author_name
|
2011-11-28 10:46:41 +01:00
|
|
|
encode(author.name)
|
2011-11-27 16:35:49 +01:00
|
|
|
end
|
2011-11-20 21:32:12 +01:00
|
|
|
end
|