MCPcopy Create free account
hub / github.com/celer-pkg/celer / GetRepoUrl

Function GetRepoUrl

pkgs/git/local.go:16–23  ·  view source on GitHub ↗

GetRepoUrl get git repo origin URL.

(repoDir string)

Source from the content-addressed store, hash-verified

14
15// GetRepoUrl get git repo origin URL.
16func GetRepoUrl(repoDir string) (string, error) {
17 cmd := exec.Command("git", "-C", repoDir, "remote", "get-url", "origin")
18 output, err := cmd.CombinedOutput()
19 if err != nil {
20 return "", fmt.Errorf("get repo url -> %s", output)
21 }
22 return strings.TrimSpace(string(output)), nil
23}
24
25// GetCurrentBranch read current branch of repo.
26func GetCurrentBranch(repoDir string) (string, error) {

Callers 1

UpdateRepoFunction · 0.85

Calls 1

CommandMethod · 0.65

Tested by

no test coverage detected