clone the checkout branch to specified path
(gitClient *git.Client, remoteURL, path string)
| 802 | |
| 803 | // clone the checkout branch to specified path |
| 804 | func localInit(gitClient *git.Client, remoteURL, path string) error { |
| 805 | ctx := context.Background() |
| 806 | gitInit, err := gitClient.Command(ctx, "init", path) |
| 807 | if err != nil { |
| 808 | return err |
| 809 | } |
| 810 | _, err = gitInit.Output() |
| 811 | if err != nil { |
| 812 | return err |
| 813 | } |
| 814 | |
| 815 | // Copy the client so we do not modify the original client's RepoDir. |
| 816 | gc := gitClient.Copy() |
| 817 | gc.RepoDir = path |
| 818 | |
| 819 | gitRemoteAdd, err := gc.Command(ctx, "remote", "add", "origin", remoteURL) |
| 820 | if err != nil { |
| 821 | return err |
| 822 | } |
| 823 | _, err = gitRemoteAdd.Output() |
| 824 | if err != nil { |
| 825 | return err |
| 826 | } |
| 827 | |
| 828 | return nil |
| 829 | } |
| 830 | |
| 831 | func interactiveRepoTemplate(client *http.Client, hostname, owner string, prompter iprompter) (*api.Repository, error) { |
| 832 | templateRepos, err := listTemplateRepositories(client, hostname, owner) |
no test coverage detected