MCPcopy Index your code
hub / github.com/cli/cli / IsLocalGitRepo

Method IsLocalGitRepo

git/client.go:704–714  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

702}
703
704func (c *Client) IsLocalGitRepo(ctx context.Context) (bool, error) {
705 _, err := c.GitDir(ctx)
706 if err != nil {
707 var execError errWithExitCode
708 if errors.As(err, &execError) && execError.ExitCode() == 128 {
709 return false, nil
710 }
711 return false, err
712 }
713 return true, nil
714}
715
716// RemoteURL returns the fetch URL configured for the named remote.
717func (c *Client) RemoteURL(ctx context.Context, name string) (string, error) {

Callers 1

NewCmdSetDefaultFunction · 0.80

Calls 2

GitDirMethod · 0.95
ExitCodeMethod · 0.95

Tested by

no test coverage detected