Skip to content

Commit eff0ca0

Browse files
peffdscho
authored andcommitted
line-log: remove output_prefix()
Now that output_prefix() returns a const char * type, it matches the behavior of diff_line_prefix() and no longer needs to exist on its own. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Derrick Stolee <[email protected]>
1 parent 1b6847f commit eff0ca0

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

line-log.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -897,16 +897,6 @@ static void print_line(const char *prefix, char first,
897897
fputs("\\ No newline at end of file\n", file);
898898
}
899899

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-
910900
static void dump_diff_hacky_one(struct rev_info *rev, struct line_log_data *range)
911901
{
912902
unsigned int i, j = 0;
@@ -916,7 +906,7 @@ static void dump_diff_hacky_one(struct rev_info *rev, struct line_log_data *rang
916906
struct diff_ranges *diff = &range->diff;
917907

918908
struct diff_options *opt = &rev->diffopt;
919-
const char *prefix = output_prefix(opt);
909+
const char *prefix = diff_line_prefix(opt);
920910
const char *c_reset = diff_get_color(opt->use_color, DIFF_RESET);
921911
const char *c_frag = diff_get_color(opt->use_color, DIFF_FRAGINFO);
922912
const char *c_meta = diff_get_color(opt->use_color, DIFF_METAINFO);
@@ -1011,7 +1001,7 @@ static void dump_diff_hacky_one(struct rev_info *rev, struct line_log_data *rang
10111001
*/
10121002
static void dump_diff_hacky(struct rev_info *rev, struct line_log_data *range)
10131003
{
1014-
const char *prefix = output_prefix(&rev->diffopt);
1004+
const char *prefix = diff_line_prefix(&rev->diffopt);
10151005

10161006
fprintf(rev->diffopt.file, "%s\n", prefix);
10171007

0 commit comments

Comments
 (0)