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:
authored and GitHub committed 2026-10-30 20:37:37 +00:00
1 parent fa41fc94d4
commit 1aff9b8cd6
3 files changed
+4 -15

No files matched your search

+2 -2
View File
@@ -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")
})
}