mirror of https://github.com/knative/func.git
fix: PaC not working with dot git suffixed url (#1713)
Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
parent
818c5ae20a
commit
f2eb853073
|
|
@ -61,5 +61,7 @@ func RepoOwnerAndNameFromUrl(url string) (string, string, error) {
|
|||
repoOwner := repoArr[0]
|
||||
repoName := repoArr[1]
|
||||
|
||||
repoName = strings.TrimSuffix(repoName, ".git")
|
||||
|
||||
return repoOwner, repoName, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,13 @@ func TestGetRepoOwnerFromGHURL(t *testing.T) {
|
|||
wantName: "bar",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "correct with dot git suffix",
|
||||
url: "https://gh/foo/bar.git",
|
||||
wantOwner: "foo",
|
||||
wantName: "bar",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "correct with capital letters",
|
||||
url: "https://gh/FOO/bar",
|
||||
|
|
|
|||
Loading…
Reference in New Issue