The example assumes two branches with a single commit being merged to the repo HEAD, so "testing the branch" and "testing the commit" are equivalent / testing the whole branch does not save you.
(But if you only test the last commit — and some implementations of "did path change?" in CI systems do this — then it is more incorrect.)