Merge branch 'dd/diff-files-unmerged-fix' into maint

"git diff --relative" segfaulted and/or produced incorrect result
when there are unmerged paths.

* dd/diff-files-unmerged-fix:
  diff-lib: ignore paths that are outside $cwd if --relative asked
This commit is contained in:
Junio C Hamano
2021-10-12 13:51:40 -07:00
2 changed files with 57 additions and 0 deletions

View File

@ -117,6 +117,10 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
if (!ce_path_match(istate, ce, &revs->prune_data, NULL))
continue;
if (revs->diffopt.prefix &&
strncmp(ce->name, revs->diffopt.prefix, revs->diffopt.prefix_length))
continue;
if (ce_stage(ce)) {
struct combine_diff_path *dpath;
struct diff_filepair *pair;