commit 5<" tmp
'
test_expect_success 'find commit msg' 'grep "
" tmp'
test_expect_success 'find diffstat' 'grep "
" tmp'
test_expect_success 'find diff summary' '
grep "1 file changed, 1 insertion, 0 deletions" tmp
'
# A strict CSP refuses an inline style, so the bar takes its widths from SVG
# attributes, which also leave the page valid.
test_expect_success 'the diffstat bar is an SVG sized by its attributes' '
grep " | " tmp
'
test_expect_success 'a commit that changes no files draws no diffstat table' '
(
cd repos/foo &&
git update-ref refs/heads/empty $(git commit-tree HEAD^{tree} -p HEAD -m empty)
) &&
cgit_url "foo/commit/&h=empty" >tmp &&
grep "0 files changed, 0 insertions, 0 deletions" tmp &&
! grep "" tmp
'
# A root commit has no parent, so it diffs against the empty tree.
test_expect_success 'get root commit' '
root=$(git -C repos/foo rev-list --max-parents=0 HEAD) &&
cgit_url "foo/commit&id=$root" >tmp &&
grep "