• 
      

    Fix parsing of `git diff-tree` output with copied/renamed files.

    Review Request #14679 — Created Nov. 7, 2025 and submitted — Latest diff uploaded

    Information

    RBTools
    master

    Reviewers

    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
    the git diff-tree output correctly.

    This change redoes the parsing to use the -z flag, 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.

    Commits

    Files