Re: [PATCH 05/15] sequencer: use logmsg_reencode in get_message
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 10, 2014, 21:40 UTC
- Message-ID
- <xmqq7g4o8mup.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20140609181039.GE20315@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> Note that we may be fixing a bug here. The existing code > does: > > if (same_encoding(to, from)) > reencode_string(buf, to, from); > > That probably should have been "!same_encoding". > > Signed-off-by: Jeff King <peff@peff.net> > --- > I didn't actually test for the bug, so it's possible that I'm missing > something clever...
Thanks for spotting. There is nothing clever going on.
0e18bcd5 (reencode_string(): introduce and use same_encoding(), 2012-10-18) has this misconversion.
diff --git a/sequencer.c b/sequencer.c index bd62680..f2f5b13 100644 --- a/sequencer.c +++ b/sequencer.c @@ -58,7 +58,7 @@ static int get_message(struct commit *commit, struct commit_message *out) out->reencoded_message = NULL; out->message = commit->buffer; - if (strcmp(encoding, git_commit_encoding)) + if (same_encoding(encoding, git_commit_encoding)) out->reencoded_message = reencode_string(commit->buffer, git_commit_encoding, encoding); if (out->reencoded_message)