Skip to content

Commit

Permalink
Merge pull request #373 from CircleCI-Public/open-format
Browse files Browse the repository at this point in the history
Failing test and some possible fixes
  • Loading branch information
marcomorain authored Mar 4, 2020
2 parents 8e35edb + ca59b57 commit 5301c30
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ func findProviderAndSlug(url string) (VcsType, string, error) {

var vcsParsers = map[VcsType][]*regexp.Regexp{
GitHub: {
regexp.MustCompile(`^git@github\.com:(.*)`),
regexp.MustCompile(`^(?:ssh\://)?git@github\.com[:/](.*)`),
regexp.MustCompile(`https://(?:.*@)?github\.com/(.*)`),
},
Bitbucket: {
regexp.MustCompile(`^git@bitbucket\.org:(.*)`),
regexp.MustCompile(`^(?:ssh\://)?git@bitbucket\.org[:/](.*)`),
regexp.MustCompile(`https://(?:.*@)?bitbucket\.org/(.*)`),
},
}
Expand Down
12 changes: 12 additions & 0 deletions git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ var _ = Describe("Dealing with git", func() {
Organization: "kiwi",
Project: "fruit",
},

"ssh://[email protected]/cloud/rain": &Remote{
VcsType: GitHub,
Organization: "cloud",
Project: "rain",
},

"ssh://[email protected]/snow/ice": &Remote{
VcsType: Bitbucket,
Organization: "snow",
Project: "ice",
},
}

for url, remote := range cases {
Expand Down

0 comments on commit 5301c30

Please sign in to comment.