MCPcopy Create free account
hub / github.com/git/git / diff_words_flush

Function diff_words_flush

diff.c:2281–2306  ·  view source on GitHub ↗

In "color-words" mode, show word-diff of words accumulated in the buffer */

Source from the content-addressed store, hash-verified

2279
2280/* In "color-words" mode, show word-diff of words accumulated in the buffer */
2281static void diff_words_flush(struct emit_callback *ecbdata)
2282{
2283 struct diff_options *wo = ecbdata->diff_words->opt;
2284
2285 if (ecbdata->diff_words->minus.text.size ||
2286 ecbdata->diff_words->plus.text.size)
2287 diff_words_show(ecbdata->diff_words);
2288
2289 if (wo->emitted_symbols) {
2290 struct diff_options *o = ecbdata->opt;
2291 struct emitted_diff_symbols *wol = wo->emitted_symbols;
2292 int i;
2293
2294 /*
2295 * NEEDSWORK:
2296 * Instead of appending each, concat all words to a line?
2297 */
2298 for (i = 0; i < wol->nr; i++)
2299 append_emitted_diff_symbol(o, &wol->buf[i]);
2300
2301 for (i = 0; i < wol->nr; i++)
2302 free((void *)wol->buf[i].line);
2303
2304 wol->nr = 0;
2305 }
2306}
2307
2308static void diff_filespec_load_driver(struct diff_filespec *one,
2309 struct index_state *istate)

Callers 2

free_diff_words_dataFunction · 0.85
fn_out_consumeFunction · 0.85

Calls 2

diff_words_showFunction · 0.85

Tested by

no test coverage detected