diff --git a/internal/model/azure.go b/internal/model/azure.go index 10b3a09..a1efd3a 100644 --- a/internal/model/azure.go +++ b/internal/model/azure.go @@ -11,13 +11,13 @@ type AzureRepo struct { } // NewAzureRepo parses a repo string and returns an AzureRepo struct -// Expects a repo string in the format org/project/repo +// Expects a repo string in the format org/project/_git/repo func NewAzureRepo(packageManager string, repo string, directory string) *AzureRepo { repoParts := strings.Split(repo, "/") for i, part := range repoParts { println(i, part) } - if len(repoParts) != 3 { + if len(repoParts) != 4 { return nil } @@ -25,7 +25,7 @@ func NewAzureRepo(packageManager string, repo string, directory string) *AzureRe PackageManger: packageManager, Org: repoParts[0], Project: repoParts[1], - Repo: repoParts[2], + Repo: repoParts[3], Directory: directory, } } diff --git a/internal/model/azure_test.go b/internal/model/azure_test.go index 5151ebf..432551b 100644 --- a/internal/model/azure_test.go +++ b/internal/model/azure_test.go @@ -16,7 +16,7 @@ func Test_NewAzureRepo(t *testing.T) { { name: "valid repo", packageManager: "npm_and_yarn", - repo: "my-org/my-project/my-repo", + repo: "my-org/my-project/_git/my-repo", directory: "/", expected: &AzureRepo{ PackageManger: "npm_and_yarn",