commit: helper methods to reduce redundant blocks of code
* builtin/commit.c: Replace block of code with a one-liner call to logmsg_reencode(). * commit.c: new function for looking up a comit by name * pretty.c: helper methods for getting output encodings Add helpers get_log_output_encoding() and get_commit_output_encoding() that eliminate some messy and duplicate if-blocks. Signed-off-by: Pat Notz <patnotz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -1032,7 +1032,7 @@ int cmd_mailinfo(int argc, const char **argv, const char *prefix)
|
||||
*/
|
||||
git_config(git_mailinfo_config, NULL);
|
||||
|
||||
def_charset = (git_commit_encoding ? git_commit_encoding : "UTF-8");
|
||||
def_charset = get_commit_output_encoding();
|
||||
metainfo_charset = def_charset;
|
||||
|
||||
while (1 < argc && argv[1][0] == '-') {
|
||||
|
Reference in New Issue
Block a user