forked from tangled.org/core
Monorepo for Tangled

knotserver: add format_patch capability

authored by anirudh.fi and committed by Tangled e68aa07c 76c5ddbb

Changed files
+7
appview
state
knotserver
types
+5
appview/state/pull.go
··· 670 670 return 671 671 } 672 672 673 + if !caps.PullRequests.FormatPatch { 674 + s.pages.Notice(w, "pull", "This knot doesn't support format-patch. Unfortunately, there is no fallback for now.") 675 + return 676 + } 677 + 673 678 // Handle the PR creation based on the type 674 679 if isBranchBased { 675 680 if !caps.PullRequests.BranchSubmissions {
+1
knotserver/routes.go
··· 37 37 38 38 capabilities := map[string]any{ 39 39 "pull_requests": map[string]any{ 40 + "format_patch": true, 40 41 "patch_submissions": true, 41 42 "branch_submissions": true, 42 43 "fork_submissions": true,
+1
types/capabilities.go
··· 2 2 3 3 type Capabilities struct { 4 4 PullRequests struct { 5 + FormatPatch bool `json:"format_patch"` 5 6 PatchSubmissions bool `json:"patch_submissions"` 6 7 BranchSubmissions bool `json:"branch_submissions"` 7 8 ForkSubmissions bool `json:"fork_submissions"`