Suppress errors when trying to generate stats for empty diffs.
Review Request #11796 — Created Aug. 18, 2021 and submitted — Latest diff uploaded
There are cases where a diffx diff section will have empty diff
content--for example, when a file is renamed but doesn't have any
changes to content. The diff stats generation will do the right thing if
a file is added without specifyingdiff=
in the constructor at all,
but was spewing errors withdiff=b''
. This change updates things to
check for falsiness rather than explicitly checking againstNone
.
- Ran with some code that was creating empty (but not
None
) diffs. Saw no
more errors. - Ran unit tests.