(repoRoot string)
| 1129 | } |
| 1130 | |
| 1131 | func 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 | |
| 1147 | func copyToClipboard(text string) error { |
| 1148 | candidates := [][]string{ |