2011-10-24 22:38:03 +03:00
|
|
|
module CommitExt
|
2011-11-12 15:18:56 +02:00
|
|
|
attr_accessor :head
|
2011-11-13 00:30:51 +02:00
|
|
|
attr_accessor :refs
|
|
|
|
|
2011-10-25 07:32:02 +03:00
|
|
|
def safe_message
|
2011-10-26 18:46:25 +05:00
|
|
|
message.encode("UTF-8",
|
|
|
|
:invalid => :replace,
|
|
|
|
:undef => :replace,
|
2011-10-25 07:32:02 +03:00
|
|
|
:universal_newline => true,
|
|
|
|
:replace => "")
|
2011-10-26 18:46:25 +05:00
|
|
|
rescue
|
2011-10-24 22:38:03 +03:00
|
|
|
"-- invalid encoding for commit message"
|
|
|
|
end
|
2011-10-31 22:57:16 +02:00
|
|
|
|
|
|
|
def created_at
|
|
|
|
committed_date
|
|
|
|
end
|
2011-11-03 06:56:26 -04: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 22:38:03 +03:00
|
|
|
end
|