Merge pull request #4460 from ywk253100/180322_repo

Fuzzy matching repository name in GET repositories API
This commit is contained in:
Daniel Jiang 2018-03-22 19:01:18 +08:00 committed by GitHub
commit ba8ca395c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,8 +156,8 @@ func repositoryQueryConditions(query ...*models.RepositoryQuery) (string, []inte
sql += `where 1=1 `
if len(q.Name) > 0 {
sql += `and r.name = ? `
params = append(params, q.Name)
sql += `and r.name like ? `
params = append(params, "%"+Escape(q.Name)+"%")
}
if len(q.ProjectIDs) > 0 {