()
| 258 | } |
| 259 | |
| 260 | func getCurrentBranch() string { |
| 261 | cmd := exec.Command("git", "branch", "--show-current") |
| 262 | out, err := cmd.Output() |
| 263 | if err != nil { |
| 264 | return "detached" |
| 265 | } |
| 266 | branch := strings.TrimSpace(string(out)) |
| 267 | if branch == "" { |
| 268 | return "detached" |
| 269 | } |
| 270 | return branch |
| 271 | } |
| 272 | |
| 273 | // getWorktreeSuggestions returns autocomplete suggestions for /worktree. |
| 274 | func (cli *ChatCLI) getWorktreeSuggestions(d prompt.Document) []prompt.Suggest { |
no test coverage detected