summaryrefslogtreecommitdiff
path: root/lib/commit_ext.rb
blob: e09dbdaf8ef042595a99ba72cd2b78d1b40057c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
module CommitExt
  def safe_message
    message.encode("UTF-8", 
                   :invalid => :replace, 
                   :undef => :replace, 
                   :universal_newline => true,
                   :replace => "")
  rescue 
    "-- invalid encoding for commit message"
  end
end