Implement detection for local repositories #32

Closed
adrianSuSE wants to merge 1 commits from local_repos into refactor

View File

@@ -300,10 +300,20 @@ func GenerateObsPrjMeta(git common.Git, gitea common.Gitea, pr *models.PullReque
// set paths to parent project
for idx, r := range meta.Repositories {
meta.Repositories[idx].Paths = []common.RepositoryPathMeta{{
Project: buildPrj,
Repository: r.Name,
}}
localRepository := false
for pidx, path := range r.Paths {
// Check for path building against a repo in template project itself
if path.Project == buildPrj {
meta.Repositories[idx].Paths[pidx].Project = meta.Name
localRepository = true
}
}
if localRepository != true {
meta.Repositories[idx].Paths = []common.RepositoryPathMeta{{
Project: buildPrj,
Repository: r.Name,
}}
}
}
return meta, nil
}