MCPcopy Create free account
hub / github.com/Scalingo/cli / repositoryHasRemote

Function repositoryHasRemote

git/setup.go:83–93  ·  view source on GitHub ↗
(ctx context.Context, repository *git.Repository, remoteName string)

Source from the content-addressed store, hash-verified

81}
82
83func repositoryHasRemote(ctx context.Context, repository *git.Repository, remoteName string) (bool, error) {
84 config, err := repository.Storer.Config()
85 if err != nil {
86 return false, errors.Wrapf(ctx, err, "fail to get Git repository config for remote %s", remoteName)
87 }
88
89 if _, has := config.Remotes[remoteName]; has {
90 return true, nil
91 }
92 return false, nil
93}

Callers 1

putRemoteInRepositoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected