Changed-files diffs that run out of time say so
Shell results can list or diff the files a command changed. Diff rendering runs under a 2 s budget. When the git ls-tree lookup for a new file's old version ran past that budget, the file was reported as "modified" with "no diff: no clean git before-image is available", a wrong statement about the file. Files the budget stopped or skipped got no explanation at all.
Now the deadline is checked after the lookup. A file whose diff the budget stopped or skipped says "no diff: the diff time budget ran out" (text approved by Ufuk), and a new file whose lookup answered in time is still reported as added with its diff.
Found on a loaded Windows CI runner (a merge-queue run of #1014), and reproduced natively 9 of 10 times with a narrowed budget. Tests cover a lookup that answers, one that fails and one that is cut off by the deadline, plus diffs skipped after the budget ran out. The other changed-files tests get an ample render budget, so runner speed no longer decides them.
Verified: 33 changed-files lib tests and 3 integration tests on Linux; Windows target check with -D warnings.
Summary by cubic
Fixes changed-files diffs hitting the 2 s render budget so they report what actually happened.
A new file's diff needs git show, which fails for files missing from HEAD, then git ls-tree to tell a new file from an unreadable one. When the budget ran out during the lookup, the file was mislabeled "no diff: no clean git before-image is available", and files skipped by the deadline got no explanation at all. The deadline is now checked after the lookup, and any file the budget stopped or skipped is marked "no diff: the diff time budget ran out" instead.
Bug Fixes
- Deadline tests use a git hook and explicit call deadlines to cover lookups that answer, fail, and time out, plus a diff that sleeps through the whole budget and one never attempted.
- Content tests get a 30 s render budget through the
capture()helper, so runner speed no longer decides them.