Issue #149 fixed
This commit is contained in:
parent
5baa5fad0a
commit
afe98ae74a
7 changed files with 15 additions and 11 deletions
|
@ -1,8 +1,10 @@
|
|||
module CommitExt
|
||||
# Cause of encoding rails truncate raise error
|
||||
# this method is temporary decision
|
||||
def truncated_message(size = 80)
|
||||
message.length > size ? (message[0..(size - 1)] + "...") : message
|
||||
def safe_message
|
||||
message.encode("UTF-8",
|
||||
:invalid => :replace,
|
||||
:undef => :replace,
|
||||
:universal_newline => true,
|
||||
:replace => "")
|
||||
rescue
|
||||
"-- invalid encoding for commit message"
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue