Fix parsing of `git diff-tree` output with copied/renamed files.
Review Request #14679 — Created Nov. 7, 2025 and updated
When a git change includes copied files and we have exclude patterns set
(either via the config file or the command-line), we were not parsing
thegit diff-treeoutput correctly.This change redoes the parsing to use the
-zflag, which splits
records with NUL characters instead of tabs (making us more resilient
with filenames). According to the diff-tree docs, the resulting records
may include either one or two files based on the change marker. If we
have a "C" (copy) or "R" (rename) change, we use the second filename as
the test for whether we should exclude the result from the diff.
Otherwise, we parse out a single filename and test that.A new unit test has been added which failed with the initial
implementation and succeeds with the new one.
- Verified that diffs were properly created with the reported situation.
- Ran unit tests.
| Summary | ID |
|---|---|
| pmswlyryrpqwxvwtoxorsqnpmqusxrky |