gitlabhq/lib/commit_ext.rb

12 lines
290 B
Ruby
Raw Normal View History

2011-10-24 22:38:03 +03:00
module CommitExt
2011-10-25 07:32:02 +03:00
def safe_message
message.encode("UTF-8",
:invalid => :replace,
:undef => :replace,
2011-10-25 07:32:02 +03:00
:universal_newline => true,
:replace => "")
rescue
2011-10-24 22:38:03 +03:00
"-- invalid encoding for commit message"
end
end