mirror of
https://github.com/harness/drone.git
synced 2025-05-07 05:10:28 +08:00
Use space path + repo path for repo IDs to search (#843)
This commit is contained in:
parent
5dc8c93233
commit
acc7083c59
@ -44,11 +44,13 @@ func (c *Controller) Search(
|
||||
return types.SearchResult{}, fmt.Errorf("failed to search repos by path: %w", err)
|
||||
}
|
||||
|
||||
if len(repoIDToPathMap) == 0 {
|
||||
repoIDToPathMap, err = c.getReposBySpacePaths(ctx, session, in.SpacePaths)
|
||||
spaceRepoIDToPathMap, err := c.getReposBySpacePaths(ctx, session, in.SpacePaths)
|
||||
if err != nil {
|
||||
return types.SearchResult{}, fmt.Errorf("failed to search repos by space path: %w", err)
|
||||
}
|
||||
|
||||
for repoID, repoPath := range spaceRepoIDToPathMap {
|
||||
repoIDToPathMap[repoID] = repoPath
|
||||
}
|
||||
|
||||
if len(repoIDToPathMap) == 0 {
|
||||
|
@ -19,7 +19,6 @@ type (
|
||||
Query string `json:"query"`
|
||||
|
||||
// RepoPaths contains the paths of repositories to search in
|
||||
// If both space path and repo path are provided, the repo path will be used
|
||||
RepoPaths []string `json:"repo_paths"`
|
||||
|
||||
// SpacePaths contains the paths of spaces to search in
|
||||
|
Loading…
Reference in New Issue
Block a user