MCPcopy Index your code
hub / github.com/bare-cli/bare / ParseGithubRepo

Function ParseGithubRepo

utils/parser/parser.go:61–82  ·  view source on GitHub ↗

Return user, repo, branch

(bareName string)

Source from the content-addressed store, hash-verified

59
60// Return user, repo, branch
61func ParseGithubRepo(bareName string) (string, string, string) {
62
63 userRepo := strings.Split(bareName, "/")
64
65 if len(userRepo) <= 1 {
66 fmt.Println("Invalid Bare path")
67 os.Exit(-1)
68 }
69
70 user := userRepo[0]
71 repo := userRepo[1]
72
73 repoBranch := strings.Split(repo, "#")
74 branch := "main"
75 if len(repoBranch) > 1 {
76 branch = repoBranch[1]
77 }
78
79 repo = repoBranch[0]
80
81 return user, repo, branch
82}

Callers 2

InfoBareFunction · 0.92
useBareFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected