MCPcopy
hub / github.com/cli/cli / resolveGitPath

Function resolveGitPath

git/client.go:896–912  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

894}
895
896func resolveGitPath() (string, error) {
897 path, err := safeexec.LookPath("git")
898 if err != nil {
899 if errors.Is(err, exec.ErrNotFound) {
900 programName := "git"
901 if runtime.GOOS == "windows" {
902 programName = "Git for Windows"
903 }
904 return "", &NotInstalled{
905 message: fmt.Sprintf("unable to find git executable in PATH; please install %s before retrying", programName),
906 err: err,
907 }
908 }
909 return "", err
910 }
911 return path, nil
912}
913
914func isFilesystemPath(p string) bool {
915 return p == "." || strings.HasPrefix(p, "./") || strings.HasPrefix(p, "/")

Callers 1

CommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected