fix: preallocate workspace prompt repo list

This commit is contained in:
Aditi Chauhan 2026-07-01 16:30:42 +05:30
parent 52008f59b2
commit aad3b89850
1 changed files with 2 additions and 1 deletions

View File

@ -1160,7 +1160,8 @@ Before editing, identify which repository owns the task and keep changes scoped
}
func workspaceRepoList(repos []domain.WorkspaceRepoRecord) string {
lines := []string{fmt.Sprintf("- %s: .", domain.RootWorkspaceRepoName)}
lines := make([]string, 0, 1+len(repos))
lines = append(lines, fmt.Sprintf("- %s: .", domain.RootWorkspaceRepoName))
for _, repo := range repos {
lines = append(lines, fmt.Sprintf("- %s: %s", repo.Name, repo.RelativePath))
}