0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-17 22:57:34 +01:00
This commit is contained in:
Lunny Xiao 2025-12-01 22:43:28 -08:00
parent d999e23d10
commit 447b7518c6
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A

View File

@ -297,13 +297,13 @@ func TestAPIUpdateBranchReference(t *testing.T) {
NewCommitID: newCommit,
OldCommitID: featureInitialCommit,
}).AddTokenAuth(ctx.Token)
ctx.Session.MakeRequest(t, staleReq, http.StatusConflict)
ctx.Session.MakeRequest(t, staleReq, http.StatusUnprocessableEntity)
nonFFReq := NewRequestWithJSON(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/%s/branches/%s", ctx.Username, ctx.Reponame, "feature"), &api.UpdateBranchRepoOption{
NewCommitID: featureInitialCommit,
OldCommitID: newCommit,
}).AddTokenAuth(ctx.Token)
ctx.Session.MakeRequest(t, nonFFReq, http.StatusConflict)
ctx.Session.MakeRequest(t, nonFFReq, http.StatusUnprocessableEntity)
forceReq := NewRequestWithJSON(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/%s/branches/%s", ctx.Username, ctx.Reponame, "feature"), &api.UpdateBranchRepoOption{
NewCommitID: featureInitialCommit,