(repo ghrepo.Interface, renamed ghrepo.Interface, opts *RenameOptions)
| 171 | } |
| 172 | |
| 173 | func updateRemote(repo ghrepo.Interface, renamed ghrepo.Interface, opts *RenameOptions) (*ghContext.Remote, error) { |
| 174 | cfg, err := opts.Config() |
| 175 | if err != nil { |
| 176 | return nil, err |
| 177 | } |
| 178 | |
| 179 | protocol := cfg.GitProtocol(repo.RepoHost()).Value |
| 180 | |
| 181 | remotes, err := opts.Remotes() |
| 182 | if err != nil { |
| 183 | return nil, err |
| 184 | } |
| 185 | |
| 186 | remote, err := remotes.FindByRepo(repo.RepoOwner(), repo.RepoName()) |
| 187 | if err != nil { |
| 188 | return nil, err |
| 189 | } |
| 190 | |
| 191 | remoteURL := ghrepo.FormatRemoteURL(renamed, protocol) |
| 192 | err = opts.GitClient.UpdateRemoteURL(context.Background(), remote.Name, remoteURL) |
| 193 | |
| 194 | return remote, err |
| 195 | } |
no test coverage detected