pretty: save commit encoding from logmsg_reencode if the caller needs it
The commit encoding is parsed by logmsg_reencode, there's no need for the caller to re-parse it again. The reencoded message now has the new encoding, not the original one. The caller would need to read commit object again before parsing. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
1468a58393
commit
5a10d23658
@ -955,7 +955,7 @@ static const char *read_commit_message(const char *name)
|
||||
if (!commit)
|
||||
die(_("could not lookup commit %s"), name);
|
||||
out_enc = get_commit_output_encoding();
|
||||
return logmsg_reencode(commit, out_enc);
|
||||
return logmsg_reencode(commit, NULL, out_enc);
|
||||
}
|
||||
|
||||
static int parse_and_validate_options(int argc, const char *argv[],
|
||||
|
Reference in New Issue
Block a user