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

Function resolveGitPath

git/client.go:958–974  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

CommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected