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

Function resolveGitPath

git/client.go:959–975  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

CommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected