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

Method IsLocalGitRepo

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

Source from the content-addressed store, hash-verified

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