mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-02 13:44:16 +09:00
fix(api): answer 409 when repository files already exist on disk (#40095)
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Signed-off-by: hktitof <hktitof@users.noreply.github.com> Co-authored-by: hktitof <hktitof@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
3 files changed
+4
-15
No files matched your search
@@ -517,7 +517,7 @@ func testAPIRepoMigrateConflict(t *testing.T, u *url.URL) {
|
||||
AddTokenAuth(httpContext.Token)
|
||||
resp := httpContext.Session.MakeRequest(t, req, http.StatusConflict)
|
||||
respJSON := DecodeJSON(t, resp, map[string]string{})
|
||||
assert.Equal(t, "The repository with the same name already exists.", respJSON["message"])
|
||||
assert.Contains(t, respJSON["message"], "already exists")
|
||||
})
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ func testAPIRepoCreateConflict(t *testing.T, u *url.URL) {
|
||||
AddTokenAuth(httpContext.Token)
|
||||
resp := httpContext.Session.MakeRequest(t, req, http.StatusConflict)
|
||||
respJSON := DecodeJSON(t, resp, map[string]string{})
|
||||
assert.Equal(t, "The repository with the same name already exists.", respJSON["message"])
|
||||
assert.Contains(t, respJSON["message"], "already exists")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user