{
struct combine_diff_path *paths = NULL;
int i, num_parent = parents->nr;
-
int output_format = opt->output_format;
- const char *orderfile = opt->orderfile;
+ char *orderfile = opt->orderfile;
opt->output_format = DIFF_FORMAT_NO_OUTPUT;
/* tell diff_tree to emit paths in sorted (=tree) order */
}
if (!strcmp(var, "diff.wordregex"))
return git_config_string(&diff_word_regex_cfg, var, value);
- if (!strcmp(var, "diff.orderfile"))
+ if (!strcmp(var, "diff.orderfile")) {
+ FREE_AND_NULL(diff_order_file_cfg);
return git_config_pathname(&diff_order_file_cfg, var, value);
+ }
if (!strcmp(var, "diff.ignoresubmodules")) {
if (!value)
if (diff_indent_heuristic)
DIFF_XDL_SET(options, INDENT_HEURISTIC);
- options->orderfile = diff_order_file_cfg;
+ options->orderfile = xstrdup_or_null(diff_order_file_cfg);
if (!options->flags.ignore_submodule_set)
options->flags.ignore_untracked_in_submodules = 1;
FREE_AND_NULL(options->objfind);
}
+ FREE_AND_NULL(options->orderfile);
for (size_t i = 0; i < options->anchors_nr; i++)
free(options->anchors[i]);
FREE_AND_NULL(options->anchors);