diff mbox series

[v3,7/8] sequencer: reencode old merge-commit message

Message ID 7f0df0f685544ab828a7f6569d5e50a975c423d3.1573031848.git.congdanhqx@gmail.com (mailing list archive)
State New, archived
Headers show
Series Correct internal working and output encoding | expand

Commit Message

Đoàn Trần Công Danh Nov. 6, 2019, 9:20 a.m. UTC
During rebasing, old merge's message (encoded in old encoding)
will be used as message for new merge commit (created by rebase).

In case of the value of i18n.commitencoding has been changed after the
old merge time. We will receive an usable message for this new merge.

Correct it.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
---
 sequencer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Eric Sunshine Nov. 6, 2019, 3:39 p.m. UTC | #1
On Wed, Nov 6, 2019 at 4:21 AM Doan Tran Cong Danh <congdanhqx@gmail.com> wrote:
> During rebasing, old merge's message (encoded in old encoding)
> will be used as message for new merge commit (created by rebase).
>
> In case of the value of i18n.commitencoding has been changed after the
> old merge time. We will receive an usable message for this new merge.

Did you mean s/usable/unusable/ ?
diff mbox series

Patch

diff --git a/sequencer.c b/sequencer.c
index 833a928929..d735d09f98 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3374,7 +3374,8 @@  static int do_merge(struct repository *r,
 	}
 
 	if (commit) {
-		const char *message = get_commit_buffer(commit, NULL);
+		const char *encoding = get_commit_output_encoding();
+		const char *message = logmsg_reencode(commit, NULL, encoding);
 		const char *body;
 		int len;