Skip to content

Commit 4c851b1

Browse files
authored
Merge branch 'main' into get-last-commit-parent-tracking
2 parents 50fa887 + b3ef6a6 commit 4c851b1

35 files changed

+1205
-855
lines changed

Dockerfile.rootless

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ USER git:git
6060
ENV GITEA_WORK_DIR /var/lib/gitea
6161
ENV GITEA_CUSTOM /var/lib/gitea/custom
6262
ENV GITEA_TEMP /tmp/gitea
63+
ENV TMPDIR /tmp/gitea
64+
6365
#TODO add to docs the ability to define the ini to load (usefull to test and revert a config)
6466
ENV GITEA_APP_INI /etc/gitea/app.ini
6567
ENV HOME "/var/lib/gitea/git"

integrations/api_repo_lfs_locks_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"time"
1212

1313
"code.gitea.io/gitea/models"
14+
"code.gitea.io/gitea/modules/lfs"
1415
"code.gitea.io/gitea/modules/setting"
1516
api "code.gitea.io/gitea/modules/structs"
1617

@@ -40,7 +41,7 @@ func TestAPILFSLocksNotLogin(t *testing.T) {
4041
repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository)
4142

4243
req := NewRequestf(t, "GET", "/%s/%s.git/info/lfs/locks", user.Name, repo.Name)
43-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
44+
req.Header.Set("Accept", lfs.MediaType)
4445
resp := MakeRequest(t, req, http.StatusUnauthorized)
4546
var lfsLockError api.LFSLockError
4647
DecodeJSON(t, resp, &lfsLockError)
@@ -102,8 +103,8 @@ func TestAPILFSLocksLogged(t *testing.T) {
102103
for _, test := range tests {
103104
session := loginUser(t, test.user.Name)
104105
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks", test.repo.FullName()), map[string]string{"path": test.path})
105-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
106-
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
106+
req.Header.Set("Accept", lfs.MediaType)
107+
req.Header.Set("Content-Type", lfs.MediaType)
107108
resp := session.MakeRequest(t, req, test.httpResult)
108109
if len(test.addTime) > 0 {
109110
var lfsLock api.LFSLockResponse
@@ -119,7 +120,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
119120
for _, test := range resultsTests {
120121
session := loginUser(t, test.user.Name)
121122
req := NewRequestf(t, "GET", "/%s.git/info/lfs/locks", test.repo.FullName())
122-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
123+
req.Header.Set("Accept", lfs.MediaType)
123124
resp := session.MakeRequest(t, req, http.StatusOK)
124125
var lfsLocks api.LFSLockList
125126
DecodeJSON(t, resp, &lfsLocks)
@@ -131,8 +132,8 @@ func TestAPILFSLocksLogged(t *testing.T) {
131132
}
132133

133134
req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks/verify", test.repo.FullName()), map[string]string{})
134-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
135-
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
135+
req.Header.Set("Accept", lfs.MediaType)
136+
req.Header.Set("Content-Type", lfs.MediaType)
136137
resp = session.MakeRequest(t, req, http.StatusOK)
137138
var lfsLocksVerify api.LFSLockListVerify
138139
DecodeJSON(t, resp, &lfsLocksVerify)
@@ -155,8 +156,8 @@ func TestAPILFSLocksLogged(t *testing.T) {
155156
for _, test := range deleteTests {
156157
session := loginUser(t, test.user.Name)
157158
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks/%s/unlock", test.repo.FullName(), test.lockID), map[string]string{})
158-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
159-
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
159+
req.Header.Set("Accept", lfs.MediaType)
160+
req.Header.Set("Content-Type", lfs.MediaType)
160161
resp := session.MakeRequest(t, req, http.StatusOK)
161162
var lfsLockRep api.LFSLockResponse
162163
DecodeJSON(t, resp, &lfsLockRep)
@@ -168,7 +169,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
168169
for _, test := range resultsTests {
169170
session := loginUser(t, test.user.Name)
170171
req := NewRequestf(t, "GET", "/%s.git/info/lfs/locks", test.repo.FullName())
171-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
172+
req.Header.Set("Accept", lfs.MediaType)
172173
resp := session.MakeRequest(t, req, http.StatusOK)
173174
var lfsLocks api.LFSLockList
174175
DecodeJSON(t, resp, &lfsLocks)

0 commit comments

Comments
 (0)