mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-21 09:51:10 +00:00
chore(refactor): partial port of Add API for Variables
(#29520)
The commit has, in addition to the implementation of the API, a few
function refactor that are useful in backports.
---
close #27801
---------
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 62b073e6f31645e446c7e8d6b5a506f61b47924e)
Conflicts:
- modules/util/util.go
Trivial resolution, only picking the newly introduced function
- routers/api/v1/swagger/options.go
Trivial resolution. We don't have UserBadges, don't pick that part.
- templates/swagger/v1_json.tmpl
Regenerated.
(cherry picked from commit 16696a42f5
)
This commit is contained in:
parent
5b30b7dc6f
commit
0e82cf121d
6 changed files with 139 additions and 73 deletions
|
@ -236,3 +236,8 @@ func TestToPointer(t *testing.T) {
|
|||
val123 := 123
|
||||
assert.NotSame(t, &val123, ToPointer(val123))
|
||||
}
|
||||
|
||||
func TestReserveLineBreakForTextarea(t *testing.T) {
|
||||
assert.Equal(t, "test\ndata", ReserveLineBreakForTextarea("test\r\ndata"))
|
||||
assert.Equal(t, "test\ndata\n", ReserveLineBreakForTextarea("test\r\ndata\r\n"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue