diff options
Diffstat (limited to 'tests/t0106-commit.sh')
-rwxr-xr-xtests/t0106-commit.sh10
1 file changed, 10 insertions, 0 deletions
diff --git a/tests/t0106-commit.sh b/tests/t0106-commit.sh
index 3b50c2b..7de0a76 100755
--- a/tests/t0106-commit.sh
+++ b/tests/t0106-commit.sh
@@ -28,6 +28,16 @@ test_expect_success 'the diffstat bar is an SVG sized by its attributes' '
grep "<td class=.graph.><svg viewBox=.0 0 1000 1. preserveAspectRatio=.none. aria-hidden=.true.><rect class=.add. width=.1000. height=.1./></svg></td>" 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 "<table class=.diffstat.>" tmp
+'
+
test_expect_success 'get root commit' '
root=$(cd repos/foo && git rev-list --reverse HEAD | head -1) &&
cgit_url "foo/commit&id=$root" >tmp &&