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

Function diff_flush_patch_all_file_pairs

diff.c:7099–7142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7097}
7098
7099static void diff_flush_patch_all_file_pairs(struct diff_options *o)
7100{
7101 int i;
7102 static struct emitted_diff_symbols esm = EMITTED_DIFF_SYMBOLS_INIT;
7103 struct diff_queue_struct *q = &diff_queued_diff;
7104
7105 if (WSEH_NEW & WS_RULE_MASK)
7106 BUG("WS rules bit mask overlaps with diff symbol flags");
7107
7108 if (o->color_moved && want_color(o->use_color))
7109 o->emitted_symbols = &esm;
7110
7111 if (o->additional_path_headers)
7112 create_filepairs_for_header_only_notifications(o);
7113
7114 for (i = 0; i < q->nr; i++) {
7115 struct diff_filepair *p = q->queue[i];
7116 if (check_pair_status(p))
7117 diff_flush_patch(p, o);
7118 }
7119
7120 if (o->emitted_symbols) {
7121 struct mem_pool entry_pool;
7122 struct moved_entry_list *entry_list;
7123
7124 mem_pool_init(&entry_pool, 1024 * 1024);
7125 entry_list = add_lines_to_move_detection(o, &entry_pool);
7126 mark_color_as_moved(o, entry_list);
7127 if (o->color_moved == COLOR_MOVED_ZEBRA_DIM)
7128 dim_moved_lines(o);
7129
7130 mem_pool_discard(&entry_pool, 0);
7131 free(entry_list);
7132
7133 for (i = 0; i < esm.nr; i++)
7134 emit_diff_symbol_from_struct(o, &esm.buf[i]);
7135
7136 for (i = 0; i < esm.nr; i++)
7137 free((void *)esm.buf[i].line);
7138 esm.nr = 0;
7139
7140 o->emitted_symbols = NULL;
7141 }
7142}
7143
7144static void diff_free_file(struct diff_options *options)
7145{

Callers 1

diff_flushFunction · 0.85

Calls 9

check_pair_statusFunction · 0.85
diff_flush_patchFunction · 0.85
mem_pool_initFunction · 0.85
mark_color_as_movedFunction · 0.85
dim_moved_linesFunction · 0.85
mem_pool_discardFunction · 0.85

Tested by

no test coverage detected