pull/35307/head
Lunny Xiao 2025-08-19 11:47:02 -07:00
parent 7eebf0b5ed
commit 0baf8c5f32
3 changed files with 6 additions and 3 deletions

View File

@ -778,7 +778,7 @@ func GetRepositoriesIDsByFullNames(ctx context.Context, fullRepoNames []string)
return nil, nil
}
var cond builder.Cond = builder.NewCond()
cond := builder.NewCond()
for _, name := range fullRepoNames {
ownerName, repoName, ok := strings.Cut(name, "/")
if !ok {

View File

@ -1,3 +1,6 @@
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package code
import (

View File

@ -19,10 +19,10 @@ func TestAPISearchCodeNotLogin(t *testing.T) {
// test with no keyword
req := NewRequest(t, "GET", "/api/v1/search/code")
resp := MakeRequest(t, req, http.StatusUnprocessableEntity)
MakeRequest(t, req, http.StatusUnprocessableEntity)
req = NewRequest(t, "GET", "/api/v1/search/code?q=Description")
resp = MakeRequest(t, req, http.StatusOK)
resp := MakeRequest(t, req, http.StatusOK)
var apiCodeSearchResults api.CodeSearchResults
DecodeJSON(t, resp, &apiCodeSearchResults)