MCPcopy Create free account
hub / github.com/diillson/chatcli / getCurrentBranch

Function getCurrentBranch

cli/worktree.go:260–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258}
259
260func 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.
274func (cli *ChatCLI) getWorktreeSuggestions(d prompt.Document) []prompt.Suggest {

Callers 2

worktreeStatusMethod · 0.85

Calls 1

OutputMethod · 0.65

Tested by

no test coverage detected