From e2b215b1c0b8fd978cd21ccb2372bb39c305e96a Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sun, 31 May 2026 08:08:20 +0000 Subject: [PATCH] appview/pages/templates,types: remove unused values Signed-off-by: Seongmin Lee --- types/repo.go | 36 ++++++++++++++++-------------------- appview/repo/index.go | 1 - knotmirror/xrpc/git_list_commits.go | 2 -- knotserver/xrpc/repo_log.go | 8 -------- appview/pages/templates/repo/fragments/og.html | 2 +- 5 file(s) changed, 17 insertion(s)(+), 32 deletion(s)(-) diff --git a/types/repo.go b/types/repo.go --- a/types/repo.go +++ b/types/repo.go @@ -6,26 +6,22 @@ ) type RepoIndexResponse struct { - IsEmpty bool `json:"is_empty"` - Ref string `json:"ref,omitempty"` - Readme string `json:"readme,omitempty"` - ReadmeFileName string `json:"readme_file_name,omitempty"` - Commits []Commit `json:"commits,omitempty"` - Description string `json:"description,omitempty"` - Files []NiceTree `json:"files,omitempty"` - Branches []Branch `json:"branches,omitempty"` - Tags []*TagReference `json:"tags,omitempty"` - TotalCommits int `json:"total_commits,omitempty"` + IsEmpty bool + Ref string + Readme string + ReadmeFileName string + Commits []Commit + Files []NiceTree + Branches []Branch + Tags []*TagReference + TotalCommits int } type RepoLogResponse struct { - Commits []Commit `json:"commits,omitempty"` - Ref string `json:"ref,omitempty"` - Description string `json:"description,omitempty"` - Log bool `json:"log,omitempty"` - Total int `json:"total,omitempty"` - Page int `json:"page,omitempty"` - PerPage int `json:"per_page,omitempty"` + Commits []Commit `json:"commits,omitempty"` + Ref string `json:"ref,omitempty"` + Total int `json:"total,omitempty"` + Page int `json:"page,omitempty"` } type RepoCommitResponse struct { @@ -93,9 +89,9 @@ const ( UpToDate ForkStatus = 0 - FastForwardable = 1 - Conflict = 2 - MissingBranch = 3 + FastForwardable ForkStatus = 1 + Conflict ForkStatus = 2 + MissingBranch ForkStatus = 3 ) type ForkInfo struct { diff --git a/appview/repo/index.go b/appview/repo/index.go --- a/appview/repo/index.go +++ b/appview/repo/index.go @@ -370,7 +370,6 @@ Readme: readmeContent, ReadmeFileName: readmeFileName, Commits: logResp.Commits, - Description: "", Files: files, Branches: branchesResp.Branches, Tags: tagsResp.Tags, diff --git a/knotmirror/xrpc/git_list_commits.go b/knotmirror/xrpc/git_list_commits.go --- a/knotmirror/xrpc/git_list_commits.go +++ b/knotmirror/xrpc/git_list_commits.go @@ -152,8 +152,6 @@ Commits: tcommits, Ref: ref, Page: (int(cursor) / limit) + 1, - PerPage: limit, Total: total, - Log: true, }, nil } diff --git a/knotserver/xrpc/repo_log.go b/knotserver/xrpc/repo_log.go --- a/knotserver/xrpc/repo_log.go +++ b/knotserver/xrpc/repo_log.go @@ -19,7 +19,6 @@ ref := r.URL.Query().Get("ref") - path := r.URL.Query().Get("path") cursor := r.URL.Query().Get("cursor") limit := 50 // default @@ -72,15 +71,8 @@ Commits: tcommits, Ref: ref, Page: (offset / limit) + 1, - PerPage: limit, Total: total, } - - if path != "" { - response.Description = path - } - - response.Log = true x.writeJson(w, response) } diff --git a/appview/pages/templates/repo/fragments/og.html b/appview/pages/templates/repo/fragments/og.html --- a/appview/pages/templates/repo/fragments/og.html +++ b/appview/pages/templates/repo/fragments/og.html @@ -1,6 +1,6 @@ {{ define "repo/fragments/og" }} {{ $title := or .Title .RepoInfo.FullName }} - {{ $description := or .Description .RepoInfo.Description "A repository on Tangled" }} + {{ $description := or .RepoInfo.Description "A repository on Tangled" }} {{ $url := or .Url (printf "https://tangled.org/%s" .RepoInfo.FullName) }} {{ $imageUrl := printf "https://tangled.org/%s/opengraph" .RepoInfo.FullName }} {{ $ownerHandle := resolve .RepoInfo.OwnerDid }} -- tangled.sh