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

Method IsLocalGitRepo

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

Source from the content-addressed store, hash-verified

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