@@ -2,7 +2,6 @@ package cmd
22
33import (
44 "fmt"
5- "io/ioutil"
65 "os"
76 "os/user"
87
@@ -13,7 +12,6 @@ import (
1312 "github.com/pkg/errors"
1413 "github.com/spf13/cobra"
1514 "gopkg.in/src-d/go-git.v4"
16- "gopkg.in/src-d/go-git.v4/plumbing/transport/ssh"
1715 "gopkg.in/src-d/go-git.v4/storage/memory"
1816)
1917
@@ -42,7 +40,7 @@ func RunCreateTestRepo(cmd *cobra.Command, args []string) {
4240
4341 org := createTestRepoFlags .Org
4442 if org == "" {
45- org = globalConfig .Github .Organization
43+ org = globalConfig .GithubTestOrg .Organization
4644 }
4745 checkEmpty (org , "Please provide an organization" )
4846
@@ -81,17 +79,10 @@ func RunCreateTestRepo(cmd *cobra.Command, args []string) {
8179 globalConfig .PublicKeyPath = fmt .Sprintf ("%s/.ssh/id_rsa" , user .HomeDir )
8280 }
8381
84- sshKey , err := ioutil .ReadFile (globalConfig .PublicKeyPath )
85- checkEmpty (err , "Error reading public key" )
86-
87- authMethod , err := ssh .NewPublicKeys ("git" , []byte (sshKey ), "" )
88- checkEmpty (err , "Error when creating public keys" )
89-
9082 color .White ("Cloning repository..." )
9183 r , err := git .Clone (memory .NewStorage (), nil , & git.CloneOptions {
92- Auth : authMethod ,
9384 Progress : os .Stdout ,
94- URL : fmt .Sprintf ("git @github.com: %s/%s" , org , testRepo ),
85+ URL : fmt .Sprintf ("https://%s @github.com/ %s/%s" , globalConfig . GithubTestOrg . Token , org , testRepo ),
9586 })
9687 checkEmpty (err , "Error cloning to repository" )
9788
0 commit comments