Skip to content

Commit a788d7d

Browse files
Axel Bonnetgitster
authored andcommitted
textconv: make the API public
The textconv functionality allows one to convert a file into text before running diff. But this functionality can be useful to other features such as blame. Signed-off-by: Axel Bonnet <[email protected]> Signed-off-by: Clément Poulain <[email protected]> Signed-off-by: Diane Gasselin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 92a75a3 commit a788d7d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

diff.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ static char diff_colors[][COLOR_MAXLEN] = {
4343
GIT_COLOR_NORMAL, /* FUNCINFO */
4444
};
4545

46-
static void diff_filespec_load_driver(struct diff_filespec *one);
47-
static size_t fill_textconv(struct userdiff_driver *driver,
48-
struct diff_filespec *df, char **outbuf);
49-
5046
static int parse_diff_color_slot(const char *var, int ofs)
5147
{
5248
if (!strcasecmp(var+ofs, "plain"))
@@ -1629,7 +1625,7 @@ void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const
16291625
options->b_prefix = b;
16301626
}
16311627

1632-
static struct userdiff_driver *get_textconv(struct diff_filespec *one)
1628+
struct userdiff_driver *get_textconv(struct diff_filespec *one)
16331629
{
16341630
if (!DIFF_FILE_VALID(one))
16351631
return NULL;
@@ -4002,9 +3998,9 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec,
40023998
return strbuf_detach(&buf, outsize);
40033999
}
40044000

4005-
static size_t fill_textconv(struct userdiff_driver *driver,
4006-
struct diff_filespec *df,
4007-
char **outbuf)
4001+
size_t fill_textconv(struct userdiff_driver *driver,
4002+
struct diff_filespec *df,
4003+
char **outbuf)
40084004
{
40094005
size_t size;
40104006

diff.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
struct rev_info;
1010
struct diff_options;
1111
struct diff_queue_struct;
12+
struct diff_filespec;
13+
struct userdiff_driver;
1214

1315
typedef void (*change_fn_t)(struct diff_options *options,
1416
unsigned old_mode, unsigned new_mode,
@@ -287,4 +289,10 @@ extern void diff_no_index(struct rev_info *, int, const char **, int, const char
287289

288290
extern int index_differs_from(const char *def, int diff_flags);
289291

292+
extern size_t fill_textconv(struct userdiff_driver *driver,
293+
struct diff_filespec *df,
294+
char **outbuf);
295+
296+
extern struct userdiff_driver *get_textconv(struct diff_filespec *one);
297+
290298
#endif /* DIFF_H */

0 commit comments

Comments
 (0)