From 0584725e08215fbbe951cec7eacd7dc2a839ccc2 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 17:45:52 -1000 Subject: Move the odd dates test to the dates tests The notes test had borrowed its repository, so it now builds one. --- tests/t0203-dates.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'tests/t0203-dates.sh') diff --git a/tests/t0203-dates.sh b/tests/t0203-dates.sh index 36b11df..5d4d72d 100755 --- a/tests/t0203-dates.sh +++ b/tests/t0203-dates.sh @@ -177,4 +177,38 @@ test_expect_success 'a date in a listing stays on one line' ' grep "^ white-space: nowrap;$" rule ' +# A pushed date or zone outside what git's date code accepts used to end the +# summary, refs and log pages inside git. Each is now shown as the epoch or +# as UTC, the way git's own log shows them. +test_expect_success 'odd dates and zones in pushed objects render' ' + test_create_repo repos/odd && + ( + cd repos/odd && + test_commit base && + c=$(git rev-parse HEAD) && + t=$(printf "object %s\\ntype commit\\ntag early\\ntagger E 1 -0100\\n\\nearly\\n" $c | + git hash-object -t tag -w --stdin) && + git update-ref refs/tags/early $t && + tree=$(git rev-parse HEAD^{tree}) && + far=$(printf "tree %s\\nauthor A 9223372036854775808 +0000\\ncommitter A 9223372036854775808 +0000\\n\\nfar\\n" $tree | + git hash-object -t commit -w --literally --stdin) && + git update-ref refs/heads/far $far && + zone=$(printf "tree %s\\nauthor A 1700000000 -2147483648\\ncommitter A 1700000000 +99999999999\\n\\nzone\\n" $tree | + git hash-object -t commit -w --literally --stdin) && + git update-ref refs/heads/zone $zone + ) && + cgitrc_repo oddrc odd && + for q in "url=odd/" "url=odd/refs/" "url=odd/tag/&h=early" \ + "url=odd/log/&h=far" "url=odd/commit/&h=far" "url=odd/commit/&h=zone" \ + "url=odd/atom/&h=far" + do + cgit_rc oddrc "$q" >tmp 2>err && + grep "^Status: 200" tmp && + ! grep "Unable to complete" tmp && + ! grep "Timestamp" err || return 1 + done && + cgit_rc oddrc "url=odd/commit/&h=far" >tmp && + grep "1970-01-01" tmp +' + test_done -- cgit 2.12.1