Skip to content

Commit

Permalink
fix: added logging if repo credentials collide
Browse files Browse the repository at this point in the history
Signed-off-by: doxsch <28098153+doxsch@users.noreply.github.com>
  • Loading branch information
doxsch committed Jan 11, 2024
1 parent 54de532 commit 33a1e2a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions util/db/repository_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ func (s *secretsRepositoryBackend) getRepositoryCredentialIndex(repoCredentials
for i, cred := range repoCredentials {
credUrl := git.NormalizeGitURL(string(cred.Data["url"]))
if strings.HasPrefix(repoURL, credUrl) {
if len(credUrl) == max {
log.Warnf("Found multiple credentials for repoURL: %s", repoURL)
}
if len(credUrl) > max {
max = len(credUrl)
idx = i
Expand Down

0 comments on commit 33a1e2a

Please sign in to comment.