From 60a59f650da76dd95f6c6221287b2745b7e44291 Mon Sep 17 00:00:00 2001 From: Saya Andy Date: Tue, 8 Sep 2026 10:07:45 +0700 Subject: diff: show the default from ref in the refs panel By default a diff against a ref is shown as that ref against its parent, but the refs panel left the from picker empty, so the controls described a different diff than the page showed. When no from ref is given, preselect the to ref with one extra commit back, which is the parent of the (stepped) to rev, and reuse the same values in the flip link. --- tests/t0106-diff.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'tests/t0106-diff.sh') diff --git a/tests/t0106-diff.sh b/tests/t0106-diff.sh index 0e45087..4490ecc 100755 --- a/tests/t0106-diff.sh +++ b/tests/t0106-diff.sh @@ -71,9 +71,17 @@ test_expect_success 'ref picker: to: shows master when id=master' ' grep "master" tmp ' -test_expect_success 'ref picker: from: empty when no id2' ' +test_expect_success 'ref picker: from: preselects the to ref when no id2' ' cgit_query "url=foo/diff" >tmp && - grep "