loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: Also substitute `COPYRIGHT HOLDER` and `the organization` in BSD 4-Clause license (#6942)

Fixes #6864

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6942
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>

authored by

Beowulf
Beowulf
and committed by
Gusted
7104c73c 486acb04

+30
+4
modules/repository/license.go
··· 1 1 // Copyright 2023 The Gitea Authors. All rights reserved. 2 + // Copyright 2025 The Forgejo Authors. All rights reserved. 2 3 // SPDX-License-Identifier: MIT 3 4 4 5 package repository ··· 107 108 } 108 109 109 110 // Other special placeholders can be added here. 111 + } else if name == "BSD-4-Clause" { 112 + ret.Owner = append(ret.Owner, "COPYRIGHT HOLDER") 113 + ret.Owner = append(ret.Owner, "the organization") 110 114 } 111 115 return ret 112 116 }
+26
modules/repository/license_test.go
··· 1 1 // Copyright 2023 The Gitea Authors. All rights reserved. 2 + // Copyright 2025 The Forgejo Authors. All rights reserved. 2 3 // SPDX-License-Identifier: MIT 3 4 4 5 package repository ··· 170 171 ... 171 172 172 173 ... THE AUTHOR BE LIABLE FOR ... 174 + `, 175 + }, 176 + { 177 + name: "BSD-4-Clause", 178 + args: args{ 179 + name: "BSD-4-Clause", 180 + values: &LicenseValues{Year: "2025", Owner: "Forgejo", Email: "hello@forgejo.org", Repo: "forgejo"}, 181 + origin: ` 182 + Copyright (c) <year> <owner>. All rights reserved. 183 + 184 + ... includes software developed by the organization. 185 + 186 + ... Neither the name of the copyright holder nor 187 + 188 + ... PROVIDED BY COPYRIGHT HOLDER "AS IS" ... NO EVENT SHALL COPYRIGHT HOLDER BE LIABLE ... 189 + `, 190 + }, 191 + want: ` 192 + Copyright (c) 2025 Forgejo. All rights reserved. 193 + 194 + ... includes software developed by Forgejo. 195 + 196 + ... Neither the name of the copyright holder nor 197 + 198 + ... PROVIDED BY Forgejo "AS IS" ... NO EVENT SHALL Forgejo BE LIABLE ... 173 199 `, 174 200 }, 175 201 }