From b1d5f1b37df91d2cb6cb9d646a4842281dee7c86 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 28 Apr 2025 15:59:23 +0100 Subject: [PATCH] appview: pulls: fix commit links in format-patch submissions the conditionals here were a bit confusing, branch-based PRs just skipped commit links altogether. --- appview/pages/templates/repo/pulls/pull.html | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/appview/pages/templates/repo/pulls/pull.html b/appview/pages/templates/repo/pulls/pull.html index 1b2f5596..3e3b96d9 100644 --- a/appview/pages/templates/repo/pulls/pull.html +++ b/appview/pages/templates/repo/pulls/pull.html @@ -88,16 +88,17 @@
{{ i "git-commit-horizontal" "w-4 h-4" }}
- {{ if not $.Pull.IsPatchBased }} - {{ $fullRepo := $.RepoInfo.FullName }} - {{ if $.Pull.IsForkBased }} - {{ if $.Pull.PullSource.Repo }} - {{ $fullRepo = printf "%s/%s" $owner $.Pull.PullSource.Repo.Name }} - {{ slice .SHA 0 8 }} - {{ else }} - {{ slice .SHA 0 8 }} - {{ end }} - {{ end }} + + {{ $fullRepo := "" }} + {{ if and $.Pull.IsForkBased $.Pull.PullSource.Repo }} + {{ $fullRepo = printf "%s/%s" $owner $.Pull.PullSource.Repo.Name }} + {{ else if $.Pull.IsBranchBased }} + {{ $fullRepo = $.RepoInfo.FullName }} + {{ end }} + + + {{ if $fullRepo }} + {{ slice .SHA 0 8 }} {{ else }} {{ slice .SHA 0 8 }} {{ end }} -- 2.51.2