MCPcopy Index your code
hub / github.com/nikivdev/go / currentBranch

Function currentBranch

cli/spec/main.go:1131–1145  ·  view source on GitHub ↗
(repoRoot string)

Source from the content-addressed store, hash-verified

1129}
1130
1131func currentBranch(repoRoot string) string {
1132 if repoRoot == "" {
1133 return ""
1134 }
1135 cmd := exec.Command("git", "-C", repoRoot, "rev-parse", "--abbrev-ref", "HEAD")
1136 out, err := cmd.Output()
1137 if err != nil {
1138 return ""
1139 }
1140 branch := strings.TrimSpace(string(out))
1141 if branch == "HEAD" {
1142 return ""
1143 }
1144 return branch
1145}
1146
1147func copyToClipboard(text string) error {
1148 candidates := [][]string{

Callers 1

buildPromptBundleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected