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:
@ -329,8 +329,7 @@ static void show_tagger(char *buf, int len, struct rev_info *rev)
|
||||
struct strbuf out = STRBUF_INIT;
|
||||
|
||||
pp_user_info("Tagger", rev->commit_format, &out, buf, rev->date_mode,
|
||||
git_log_output_encoding ?
|
||||
git_log_output_encoding: git_commit_encoding);
|
||||
get_log_output_encoding());
|
||||
printf("%s", out.buf);
|
||||
strbuf_release(&out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user