diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Backfill an absent commit message
Diffstat (limited to 'tests')
-rw-r--r--tests/t0200-security.sh22
1 file changed, 22 insertions, 0 deletions
diff --git a/tests/t0200-security.sh b/tests/t0200-security.sh
index 4eee9ae..83cdbfd 100644
--- a/tests/t0200-security.sh
+++ b/tests/t0200-security.sh
@@ -175,4 +175,26 @@ test_expect_success 'ssdiff percent-encodes a quoted file path' '
! grep "href=.[^>]*x.y.txt.[^>]*>" tmp
'
+# --- A commit with no message must not crash the history views --------------
+test_expect_success 'a message-less commit renders without crashing' '
+ mkrepo repos/nomsg 1 &&
+ (
+ cd repos/nomsg &&
+ tree=$(git write-tree) &&
+ printf "tree %s\nauthor a <a@b> 1735689600 +0000\ncommitter a <a@b> 1735689600 +0000\n" "$tree" >raw &&
+ cid=$(git hash-object -t commit -w raw) &&
+ git update-ref refs/heads/master "$cid"
+ ) &&
+ {
+ echo "virtual-root=/" &&
+ echo "cache-size=0" &&
+ echo "repo.url=nomsg" &&
+ echo "repo.path=$PWD/repos/nomsg/.git"
+ } >nomsgrc &&
+ CGIT_CONFIG="$PWD/nomsgrc" QUERY_STRING="url=nomsg/log/&showmsg=1" cgit >tmp &&
+ grep "no commit message" tmp &&
+ CGIT_CONFIG="$PWD/nomsgrc" QUERY_STRING="url=nomsg/" cgit >tmp &&
+ grep "no commit message" tmp
+'
+
test_done