(opts *CloneOptions)
| 73 | } |
| 74 | |
| 75 | func cloneRun(opts *CloneOptions) error { |
| 76 | gistURL := opts.Gist |
| 77 | |
| 78 | if !git.IsURL(gistURL) { |
| 79 | cfg, err := opts.Config() |
| 80 | if err != nil { |
| 81 | return err |
| 82 | } |
| 83 | hostname, _ := cfg.Authentication().DefaultHost() |
| 84 | protocol := cfg.GitProtocol(hostname).Value |
| 85 | gistURL = formatRemoteURL(hostname, gistURL, protocol) |
| 86 | } |
| 87 | |
| 88 | _, err := opts.GitClient.Clone(context.Background(), gistURL, opts.GitArgs) |
| 89 | if err != nil { |
| 90 | return err |
| 91 | } |
| 92 | |
| 93 | return nil |
| 94 | } |
| 95 | |
| 96 | func formatRemoteURL(hostname string, gistID string, protocol string) string { |
| 97 | if ghauth.IsEnterprise(hostname) { |
no test coverage detected