Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
mailinfo: move check for metainfo_charset to convert_to_utf8()
author
Junio C Hamano
<gitster@pobox.com>
Sun, 18 Oct 2015 22:58:35 +0000
(15:58 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 21 Oct 2015 22:50:17 +0000
(15:50 -0700)
All callers of this function refrain from calling it when
mi->metainfo_charset is NULL; move the check to the callee,
as it already has a few conditions at its beginning to turn
it into a no-op.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mailinfo.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
28be2d0
)
diff --git
a/builtin/mailinfo.c
b/builtin/mailinfo.c
index 0b49bf6a1a5a7c36ececef42a4f421a82f9bdf76..1048a46e40aa2cf51f84606abf8ea5655e65c0d6 100644
(file)
--- a/
builtin/mailinfo.c
+++ b/
builtin/mailinfo.c
@@
-384,7
+384,7
@@
static void convert_to_utf8(struct mailinfo *mi,
{
char *out;
{
char *out;
- if (!charset || !*charset)
+ if (!
mi->metainfo_charset || !
charset || !*charset)
return;
if (same_encoding(mi->metainfo_charset, charset))
return;
if (same_encoding(mi->metainfo_charset, charset))
@@
-459,8
+459,7
@@
static void decode_header(struct mailinfo *mi, struct strbuf *it)
dec = decode_q_segment(&piecebuf, 1);
break;
}
dec = decode_q_segment(&piecebuf, 1);
break;
}
- if (mi->metainfo_charset)
- convert_to_utf8(mi, dec, charset_q.buf);
+ convert_to_utf8(mi, dec, charset_q.buf);
strbuf_addbuf(&outbuf, dec);
strbuf_release(dec);
strbuf_addbuf(&outbuf, dec);
strbuf_release(dec);
@@
-674,8
+673,7
@@
static int handle_commit_msg(struct mailinfo *mi, struct strbuf *line)
mi->header_stage = 0;
/* normalize the log message to UTF-8. */
mi->header_stage = 0;
/* normalize the log message to UTF-8. */
- if (mi->metainfo_charset)
- convert_to_utf8(mi, line, charset.buf);
+ convert_to_utf8(mi, line, charset.buf);
if (mi->use_scissors && is_scissors_line(line)) {
int i;
if (mi->use_scissors && is_scissors_line(line)) {
int i;