Commit 26bdeb2107d7d55aa89132d9c060421bd377c9f0
1 parent
2a874a00
Exists in
master
and in
4 other branches
commit safe_commit
Showing
1 changed file
with
1 additions
and
7 deletions
Show diff stats
lib/commit_ext.rb
@@ -3,13 +3,7 @@ module CommitExt | @@ -3,13 +3,7 @@ module CommitExt | ||
3 | attr_accessor :refs | 3 | attr_accessor :refs |
4 | 4 | ||
5 | def safe_message | 5 | def safe_message |
6 | - message.encode("UTF-8", | ||
7 | - :invalid => :replace, | ||
8 | - :undef => :replace, | ||
9 | - :universal_newline => true, | ||
10 | - :replace => "") | ||
11 | - rescue | ||
12 | - "-- invalid encoding for commit message" | 6 | + message.force_encoding(Encoding::UTF_8) |
13 | end | 7 | end |
14 | 8 | ||
15 | def created_at | 9 | def created_at |