MCPcopy Index your code
hub / github.com/git/git / repo_diff_setup

Function repo_diff_setup

diff.c:5136–5180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5134}
5135
5136void repo_diff_setup(struct repository *r, struct diff_options *options)
5137{
5138 memcpy(options, &default_diff_options, sizeof(*options));
5139
5140 options->file = stdout;
5141 options->repo = r;
5142
5143 options->output_indicators[OUTPUT_INDICATOR_NEW] = '+';
5144 options->output_indicators[OUTPUT_INDICATOR_OLD] = '-';
5145 options->output_indicators[OUTPUT_INDICATOR_CONTEXT] = ' ';
5146 options->abbrev = DEFAULT_ABBREV;
5147 options->line_termination = '\n';
5148 options->break_opt = -1;
5149 options->rename_limit = -1;
5150 options->dirstat_permille = diff_dirstat_permille_default;
5151 options->context = diff_context_default;
5152 options->interhunkcontext = diff_interhunk_context_default;
5153 options->ws_error_highlight = ws_error_highlight_default;
5154 options->flags.rename_empty = 1;
5155 options->flags.relative_name = diff_relative;
5156 options->objfind = NULL;
5157
5158 /* pathchange left =NULL by default */
5159 options->change = diff_change;
5160 options->add_remove = diff_addremove;
5161 options->use_color = diff_use_color_default;
5162 options->detect_rename = diff_detect_rename_default;
5163 options->xdl_opts |= diff_algorithm;
5164 if (diff_indent_heuristic)
5165 DIFF_XDL_SET(options, INDENT_HEURISTIC);
5166
5167 options->orderfile = xstrdup_or_null(diff_order_file_cfg);
5168
5169 if (!options->flags.ignore_submodule_set)
5170 options->flags.ignore_untracked_in_submodules = 1;
5171
5172 if (diff_no_prefix) {
5173 diff_set_noprefix(options);
5174 } else if (!diff_mnemonic_prefix) {
5175 diff_set_default_prefix(options);
5176 }
5177
5178 options->color_moved = diff_color_moved_default;
5179 options->color_moved_ws_handling = diff_color_moved_ws_default;
5180}
5181
5182static const char diff_status_letters[] = {
5183 DIFF_STATUS_ADDED,

Callers 15

detect_regular_renamesFunction · 0.85
queue_diffsFunction · 0.85
try_to_follow_renamesFunction · 0.85
find_originFunction · 0.85
find_renameFunction · 0.85
find_copy_in_parentFunction · 0.85
outputFunction · 0.85
repo_init_revisionsFunction · 0.85
show_diff_of_diffFunction · 0.85
init_patch_idsFunction · 0.85
diff_tree_remoteFunction · 0.85

Calls 3

xstrdup_or_nullFunction · 0.85
diff_set_noprefixFunction · 0.85
diff_set_default_prefixFunction · 0.85

Tested by

no test coverage detected