MCPcopy Create free account
hub / github.com/cli/cli / resolveGitPath

Function resolveGitPath

git/client.go:956–972  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

954}
955
956func resolveGitPath() (string, error) {
957 path, err := safeexec.LookPath("git")
958 if err != nil {
959 if errors.Is(err, exec.ErrNotFound) {
960 programName := "git"
961 if runtime.GOOS == "windows" {
962 programName = "Git for Windows"
963 }
964 return "", &NotInstalled{
965 message: fmt.Sprintf("unable to find git executable in PATH; please install %s before retrying", programName),
966 err: err,
967 }
968 }
969 return "", err
970 }
971 return path, nil
972}
973
974func isFilesystemPath(p string) bool {
975 return p == "." || strings.HasPrefix(p, "./") || strings.HasPrefix(p, "/")

Callers 1

CommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected