2011-10-24 21:38:03 +02:00
|
|
|
module CommitExt
|
2011-11-12 14:18:56 +01:00
|
|
|
attr_accessor :head
|
|
|
|
|
2011-10-25 06:32:02 +02:00
|
|
|
def safe_message
|
2011-10-26 15:46:25 +02:00
|
|
|
message.encode("UTF-8",
|
|
|
|
:invalid => :replace,
|
|
|
|
:undef => :replace,
|
2011-10-25 06:32:02 +02:00
|
|
|
:universal_newline => true,
|
|
|
|
:replace => "")
|
2011-10-26 15:46:25 +02:00
|
|
|
rescue
|
2011-10-24 21:38:03 +02:00
|
|
|
"-- invalid encoding for commit message"
|
|
|
|
end
|
2011-10-31 21:57:16 +01:00
|
|
|
|
|
|
|
def created_at
|
|
|
|
committed_date
|
|
|
|
end
|
2011-11-03 11:56:26 +01:00
|
|
|
|
|
|
|
def author_email
|
|
|
|
author.email.force_encoding(Encoding::UTF_8)
|
|
|
|
end
|
|
|
|
|
|
|
|
def author_name
|
|
|
|
author.name.force_encoding(Encoding::UTF_8)
|
|
|
|
end
|
2011-10-24 21:38:03 +02:00
|
|
|
end
|