diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-08 22:30:31 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-08 22:30:31 +0200 |
commit | c8f491668e46d66290aec97caaf94fe2c1ecccbd (patch) | |
tree | f2b793ddaf748fd0d11c2394d9fb24ecbd07d68a /diff-lib.c | |
parent | Merge branch 'dd/t6300-wo-gpg-fix' (diff) | |
parent | diff-lib: ignore paths that are outside $cwd if --relative asked (diff) | |
download | git-c8f491668e46d66290aec97caaf94fe2c1ecccbd.tar.xz git-c8f491668e46d66290aec97caaf94fe2c1ecccbd.zip |
Merge branch 'dd/diff-files-unmerged-fix'
"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
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/diff-lib.c b/diff-lib.c index f9eadc4fc1..ca085a03ef 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -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; |