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

Method IsLocalGitRepo

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

Source from the content-addressed store, hash-verified

765}
766
767func (c *Client) IsLocalGitRepo(ctx context.Context) (bool, error) {
768 _, err := c.GitDir(ctx)
769 if err != nil {
770 var execError errWithExitCode
771 if errors.As(err, &execError) && execError.ExitCode() == 128 {
772 return false, nil
773 }
774 return false, err
775 }
776 return true, nil
777}
778
779// RemoteURL returns the fetch URL configured for the named remote.
780func (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