MCPcopy Create free account
hub / github.com/nikivdev/go / currentGitBranch

Function currentGitBranch

cli/flow/main.go:4990–5002  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4988}
4989
4990func currentGitBranch() (string, error) {
4991 out, err := exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD").Output()
4992 if err != nil {
4993 trimmed := strings.TrimSpace(string(out))
4994 if trimmed != "" {
4995 return "", fmt.Errorf("%s", trimmed)
4996 }
4997 return "", fmt.Errorf("git rev-parse --abbrev-ref HEAD: %w", err)
4998 }
4999
5000 branch := strings.TrimSpace(string(out))
5001 return branch, nil
5002}
5003
5004func urlsEquivalent(a, b string) bool {
5005 na := normalizeRemoteURL(a)

Callers 4

runGitSyncForkFunction · 0.85
runGitMirrorPullFunction · 0.85
runGitMirrorTakeFunction · 0.85
resolveGitMirrorBranchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected