]> Kevux Git Server - rit/commit
mailinfo: load default metainfo_charset lazily
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Thu, 6 May 2021 15:02:18 +0000 (22:02 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 May 2021 21:40:25 +0000 (06:40 +0900)
commitd582992e80aa29c37cb449922e713a0c288ffe91
treef2c60a7d73adc4ecf519308118cf37ee7ec1bcd8
parent7e391989789db82983665667013a46eabc6fc570
mailinfo: load default metainfo_charset lazily

In a later change, we will use parse_option to parse mailinfo's options.
In mailinfo, both "-u", "-n", and "--encoding" try to set the same
field, with "-u" reset that field to some default value from
configuration variable "i18n.commitEncoding".

Let's delay the setting of that field until we finish processing all
options. By doing that, "i18n.commitEncoding" can be parsed on demand.
More importantly, it cleans the way for using parse_option.

This change introduces some inconsistent brackets "{}" in "if/else if"
construct, however, we will rewrite them in the next few changes.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mailinfo.c