line-log: use diff_line_prefix() instead of custom helper

Our local output_prefix() is exactly the same as the public diff_line_prefix() function. Let's just use that one, saving us a little bit of code. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 3, 2024 at 17:06 UTC 8aeff2c287aea1a8673d78574a5709510a789640
1 file changed +2 -12
line-log.c
+2 -12
@@ -897,16 +897,6 @@ static void print_line(const char *prefix, char first,
897 fputs("\\ No newline at end of file\n", file);
898 }
899
900 -static const char *output_prefix(struct diff_options *opt)
901 -{
902 - if (opt->output_prefix) {
903 - struct strbuf *sb = opt->output_prefix(opt, opt->output_prefix_data);
904 - return sb->buf;
905 - } else {
906 - return "";
907 - }
908 -}
909 -
900 static void dump_diff_hacky_one(struct rev_info *rev, struct line_log_data *range)
901 {
902 unsigned int i, j = 0;
@@ -916,7 +906,7 @@ static void dump_diff_hacky_one(struct rev_info *rev, struct line_log_data *rang
906 struct diff_ranges *diff = &range->diff;
907
908 struct diff_options *opt = &rev->diffopt;
919 - const char *prefix = output_prefix(opt);
909 + const char *prefix = diff_line_prefix(opt);
910 const char *c_reset = diff_get_color(opt->use_color, DIFF_RESET);
911 const char *c_frag = diff_get_color(opt->use_color, DIFF_FRAGINFO);
912 const char *c_meta = diff_get_color(opt->use_color, DIFF_METAINFO);
@@ -1011,7 +1001,7 @@ out:
1001 */
1002 static void dump_diff_hacky(struct rev_info *rev, struct line_log_data *range)
1003 {
1014 - const char *prefix = output_prefix(&rev->diffopt);
1004 + const char *prefix = diff_line_prefix(&rev->diffopt);
1005
1006 fprintf(rev->diffopt.file, "%s\n", prefix);
1007