gitlabhq/app/models/commit.rb
Saito 46cbe54189 fix the issue on github #157.
directly force_encoding is wrong,
must detect the file string's encoding.
then force_encoding the string to it's encoding.
last convert it to utf-8.
2011-11-28 17:46:41 +08:00

40 lines
527 B
Ruby

class Commit
include Utils::CharEncode
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
encode(message)
end
def created_at
committed_date
end
def author_email
encode(author.email)
end
def author_name
encode(author.name)
end
end