Merge branch 'jc/rename-degrade-cc-to-c'
* jc/rename-degrade-cc-to-c: diffcore-rename: fall back to -C when -C -C busts the rename limit diffcore-rename: record filepair for rename src diffcore-rename: refactor "too many candidates" logic builtin/diff.c: remove duplicated call to diff_result_code()
This commit is contained in:
@ -163,6 +163,9 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
|
||||
}
|
||||
|
||||
if (read_stdin) {
|
||||
int saved_nrl = 0;
|
||||
int saved_dcctc = 0;
|
||||
|
||||
if (opt->diffopt.detect_rename)
|
||||
opt->diffopt.setup |= (DIFF_SETUP_USE_SIZE_CACHE |
|
||||
DIFF_SETUP_USE_CACHE);
|
||||
@ -173,9 +176,16 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
|
||||
fputs(line, stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
else
|
||||
else {
|
||||
diff_tree_stdin(line);
|
||||
if (saved_nrl < opt->diffopt.needed_rename_limit)
|
||||
saved_nrl = opt->diffopt.needed_rename_limit;
|
||||
if (opt->diffopt.degraded_cc_to_c)
|
||||
saved_dcctc = 1;
|
||||
}
|
||||
}
|
||||
opt->diffopt.degraded_cc_to_c = saved_dcctc;
|
||||
opt->diffopt.needed_rename_limit = saved_nrl;
|
||||
}
|
||||
|
||||
return diff_result_code(&opt->diffopt, 0);
|
||||
|
@ -202,7 +202,6 @@ static void refresh_index_quietly(void)
|
||||
|
||||
static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv)
|
||||
{
|
||||
int result;
|
||||
unsigned int options = 0;
|
||||
|
||||
while (1 < argc && argv[1][0] == '-') {
|
||||
@ -236,8 +235,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
|
||||
perror("read_cache_preload");
|
||||
return -1;
|
||||
}
|
||||
result = run_diff_files(revs, options);
|
||||
return diff_result_code(&revs->diffopt, result);
|
||||
return run_diff_files(revs, options);
|
||||
}
|
||||
|
||||
int cmd_diff(int argc, const char **argv, const char *prefix)
|
||||
|
@ -256,6 +256,8 @@ static void finish_early_output(struct rev_info *rev)
|
||||
static int cmd_log_walk(struct rev_info *rev)
|
||||
{
|
||||
struct commit *commit;
|
||||
int saved_nrl = 0;
|
||||
int saved_dcctc = 0;
|
||||
|
||||
if (rev->early_output)
|
||||
setup_early_output(rev);
|
||||
@ -286,7 +288,14 @@ static int cmd_log_walk(struct rev_info *rev)
|
||||
}
|
||||
free_commit_list(commit->parents);
|
||||
commit->parents = NULL;
|
||||
if (saved_nrl < rev->diffopt.needed_rename_limit)
|
||||
saved_nrl = rev->diffopt.needed_rename_limit;
|
||||
if (rev->diffopt.degraded_cc_to_c)
|
||||
saved_dcctc = 1;
|
||||
}
|
||||
rev->diffopt.degraded_cc_to_c = saved_dcctc;
|
||||
rev->diffopt.needed_rename_limit = saved_nrl;
|
||||
|
||||
if (rev->diffopt.output_format & DIFF_FORMAT_CHECKDIFF &&
|
||||
DIFF_OPT_TST(&rev->diffopt, CHECK_FAILED)) {
|
||||
return 02;
|
||||
|
Reference in New Issue
Block a user