@@ -18,24 +18,22 @@ type GitHubRepo struct {
1818// Function which parses string to a github repo information, adn returns a object and error (if any)
1919func NewGitHubRepo (target string ) (repo Repo , err error ) {
2020 repo = & GitHubRepo {}
21- var targetParts []string ;
2221
23- if strings .HasPrefix (target , "gh:" ) {
24- // Take the `gh:user/repo` Remove "gh:" and split `user` and `repo`
25- targetParts = strings .Split (target [3 :], "/" )
26- } else {
27- // Take the `gh:user/repo` and split `user` and `repo`
28- targetParts = strings .Split (target , "/" )
29- }
22+ // Take the `user/repo` and split `user` and `repo`
23+ targetParts := strings .Split (target , "/" )
24+ ghSource := GitHubRepo {}
3025
3126 targetPartsLen := len (targetParts )
3227 if targetPartsLen < 2 {
33- return repo , InvalidTargetFormat
34- }
35-
36- ghSource := GitHubRepo {
37- User : targetParts [0 ],
38- Project : targetParts [1 ],
28+ ghSource = GitHubRepo {
29+ User : targetParts [0 ],
30+ Project : targetParts [0 ],
31+ }
32+ } else {
33+ ghSource = GitHubRepo {
34+ User : targetParts [0 ],
35+ Project : targetParts [1 ],
36+ }
3937 }
4038
4139 if targetPartsLen > 2 {
@@ -51,7 +49,7 @@ func NewGitHubRepo(target string) (repo Repo, err error) {
5149
5250// Function to get the github repo id from the repo information
5351func (g GitHubRepo ) Id () string {
54- id := "gh:" + g .User + "/" + g .Project
52+ id := g .User + "/" + g .Project
5553
5654 return id
5755}
0 commit comments