Skip to content

Commit a54fd00

Browse files
authored
Merge branch 'main' into fix_13283
2 parents c917dec + 7821370 commit a54fd00

File tree

10 files changed

+97
-6
lines changed

10 files changed

+97
-6
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.15.8](https://github.com/go-gitea/gitea/releases/tag/v1.15.8) - 2021-12-20
8+
9+
* BUGFIXES
10+
* Move POST /{username}/action/{action} to simply POST /{username} (#18045) (#18046)
11+
* Fix delete u2f keys bug (#18040) (#18042)
12+
* Reset Session ID on login (#18018) (#18041)
13+
* Prevent off-by-one error on comments on newly appended lines (#18029) (#18035)
14+
* Stop printing 03d after escaped characters in logs (#18030) (#18034)
15+
* Reset locale on login (#18023) (#18025)
16+
* Fix reset password email template (#17025) (#18022)
17+
* Fix outType on gitea dump (#18000) (#18016)
18+
* Ensure complexity, minlength and isPwned are checked on password setting (#18005) (#18015)
19+
* Fix rename notification bug (#18011)
20+
* Prevent double decoding of % in url params (#17997) (#18001)
21+
* Prevent hang in git cat-file if the repository is not a valid repository (Partial #17991) (#17992)
22+
* Prevent deadlock in create issue (#17970) (#17982)
23+
* TESTING
24+
* Use non-expiring key. (#17984) (#17985)
25+
726
## [1.15.7](https://github.com/go-gitea/gitea/releases/tag/v1.15.7) - 2021-12-01
827

928
* ENHANCEMENTS

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
###################################
3-
#Build stage
4-
FROM golang:1.17-alpine3.13 AS build-env
3+
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4+
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
55

66
ARG GOPROXY
77
ENV GOPROXY ${GOPROXY:-direct}

Dockerfile.rootless

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
###################################
3-
#Build stage
4-
FROM golang:1.17-alpine3.13 AS build-env
3+
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4+
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
55

66
ARG GOPROXY
77
ENV GOPROXY ${GOPROXY:-direct}

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.15.7
21+
version: 1.15.8
2222
minGoVersion: 1.16
2323
goVersion: 1.17
2424
minNodeVersion: 12.17

integrations/api_repo_lfs_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ func TestAPILFSBatch(t *testing.T) {
278278
meta, err = models.GetLFSMetaObjectByOid(repo.ID, p.Oid)
279279
assert.NoError(t, err)
280280
assert.NotNil(t, meta)
281+
282+
// Cleanup
283+
err = contentStore.Delete(p.RelativePath())
284+
assert.NoError(t, err)
281285
})
282286

283287
t.Run("AlreadyExists", func(t *testing.T) {
@@ -378,6 +382,10 @@ func TestAPILFSUpload(t *testing.T) {
378382
assert.NoError(t, err)
379383
assert.NotNil(t, meta)
380384
})
385+
386+
// Cleanup
387+
err = contentStore.Delete(p.RelativePath())
388+
assert.NoError(t, err)
381389
})
382390

383391
t.Run("MetaAlreadyExists", func(t *testing.T) {

integrations/mirror_push_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"fmt"
1010
"net/http"
1111
"net/url"
12+
"strconv"
1213
"testing"
1314

1415
"code.gitea.io/gitea/models"
@@ -68,6 +69,12 @@ func testMirrorPush(t *testing.T, u *url.URL) {
6869
assert.NoError(t, err)
6970

7071
assert.Equal(t, srcCommit.ID, mirrorCommit.ID)
72+
73+
// Cleanup
74+
doRemovePushMirror(ctx, fmt.Sprintf("%s%s/%s", u.String(), url.PathEscape(ctx.Username), url.PathEscape(mirrorRepo.Name)), user.LowerName, userPassword, int(mirrors[0].ID))(t)
75+
mirrors, err = repo_model.GetPushMirrorsByRepoID(srcRepo.ID)
76+
assert.NoError(t, err)
77+
assert.Len(t, mirrors, 0)
7178
}
7279

7380
func doCreatePushMirror(ctx APITestContext, address, username, password string) func(t *testing.T) {
@@ -89,3 +96,24 @@ func doCreatePushMirror(ctx APITestContext, address, username, password string)
8996
assert.Contains(t, flashCookie.Value, "success")
9097
}
9198
}
99+
100+
func doRemovePushMirror(ctx APITestContext, address, username, password string, pushMirrorID int) func(t *testing.T) {
101+
return func(t *testing.T) {
102+
csrf := GetCSRF(t, ctx.Session, fmt.Sprintf("/%s/%s/settings", url.PathEscape(ctx.Username), url.PathEscape(ctx.Reponame)))
103+
104+
req := NewRequestWithValues(t, "POST", fmt.Sprintf("/%s/%s/settings", url.PathEscape(ctx.Username), url.PathEscape(ctx.Reponame)), map[string]string{
105+
"_csrf": csrf,
106+
"action": "push-mirror-remove",
107+
"push_mirror_id": strconv.Itoa(pushMirrorID),
108+
"push_mirror_address": address,
109+
"push_mirror_username": username,
110+
"push_mirror_password": password,
111+
"push_mirror_interval": "0",
112+
})
113+
ctx.Session.MakeRequest(t, req, http.StatusFound)
114+
115+
flashCookie := ctx.Session.GetCookie("macaron_flash")
116+
assert.NotNil(t, flashCookie)
117+
assert.Contains(t, flashCookie.Value, "success")
118+
}
119+
}

integrations/repo_tag_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,24 @@ func TestCreateNewTagProtected(t *testing.T) {
7474
assert.Contains(t, err.Error(), "Tag v-2 is protected")
7575
})
7676
})
77+
78+
// Cleanup
79+
releases, err := models.GetReleasesByRepoID(repo.ID, models.FindReleasesOptions{
80+
IncludeTags: true,
81+
TagNames: []string{"v-1", "v-1.1"},
82+
})
83+
assert.NoError(t, err)
84+
85+
for _, release := range releases {
86+
err = models.DeleteReleaseByID(release.ID)
87+
assert.NoError(t, err)
88+
}
89+
90+
protectedTags, err := models.GetProtectedTags(repo.ID)
91+
assert.NoError(t, err)
92+
93+
for _, protectedTag := range protectedTags {
94+
err = models.DeleteProtectedTag(protectedTag)
95+
assert.NoError(t, err)
96+
}
7797
}

modules/git/repo_tag_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,12 @@ func TestRepository_GetTag(t *testing.T) {
5050
aTagID, _ := bareRepo1.GetTagID(aTagName)
5151

5252
lTag, err := bareRepo1.GetTag(lTagName)
53-
lTag.repo = nil
5453
assert.NoError(t, err)
5554
assert.NotNil(t, lTag)
55+
if lTag == nil {
56+
assert.FailNow(t, "nil lTag: %s", lTagName)
57+
}
58+
lTag.repo = nil
5659
assert.EqualValues(t, lTagName, lTag.Name)
5760
assert.EqualValues(t, lTagCommitID, lTag.ID.String())
5861
assert.EqualValues(t, lTagCommitID, lTag.Object.String())
@@ -61,6 +64,9 @@ func TestRepository_GetTag(t *testing.T) {
6164
aTag, err := bareRepo1.GetTag(aTagName)
6265
assert.NoError(t, err)
6366
assert.NotNil(t, aTag)
67+
if aTag == nil {
68+
assert.FailNow(t, "nil aTag: %s", aTagName)
69+
}
6470
assert.EqualValues(t, aTagName, aTag.Name)
6571
assert.EqualValues(t, aTagID, aTag.ID.String())
6672
assert.NotEqual(t, aTagID, aTag.Object.String())

routers/api/v1/repo/transfer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ func Transfer(ctx *context.APIContext) {
9898
}
9999
}
100100

101+
if ctx.Repo.GitRepo != nil {
102+
ctx.Repo.GitRepo.Close()
103+
ctx.Repo.GitRepo = nil
104+
}
105+
101106
if err := repo_service.StartRepositoryTransfer(ctx.User, newOwner, ctx.Repo.Repository, teams); err != nil {
102107
if models.IsErrRepoTransferInProgress(err) {
103108
ctx.Error(http.StatusConflict, "CreatePendingRepositoryTransfer", err)

routers/web/repo/repo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,11 @@ func acceptOrRejectRepoTransfer(ctx *context.Context, accept bool) error {
323323
}
324324

325325
if accept {
326+
if ctx.Repo.GitRepo != nil {
327+
ctx.Repo.GitRepo.Close()
328+
ctx.Repo.GitRepo = nil
329+
}
330+
326331
if err := repo_service.TransferOwnership(repoTransfer.Doer, repoTransfer.Recipient, ctx.Repo.Repository, repoTransfer.Teams); err != nil {
327332
return err
328333
}

0 commit comments

Comments
 (0)