Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
colussim committed May 6, 2024
1 parent 9104935 commit f01d6e6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pkg/devops/getbitbucket/getbitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,13 +922,11 @@ func isRepositoryEmpty(workspace, repoSlug, accessToken, bitbucketURLBase string

urlMain := fmt.Sprintf("%srepositories/%s/%s/src/main/?pagelen=100", bitbucketURLBase, workspace, repoSlug)

// Récupérer les fichiers de la branche principale
filesResp, err := fetchFiles(urlMain, accessToken)
if err != nil {
return false, fmt.Errorf("❌ Error when testing if repo: %s is empty - Function: %s - %v", repoSlug, "getbibucket-isRepositoryEmpty", err)
}

// Si la réponse est nulle, essayer avec la branche "master"
if filesResp == nil {
urlMaster := fmt.Sprintf("%srepositories/%s/%s/src/master/?pagelen=100", bitbucketURLBase, workspace, repoSlug)
filesResp, err = fetchFiles(urlMaster, accessToken)
Expand All @@ -937,7 +935,6 @@ func isRepositoryEmpty(workspace, repoSlug, accessToken, bitbucketURLBase string
}
}

// Vérifier si la liste de fichiers est vide
if len(filesResp.Values) == 0 {
return true, nil
}
Expand Down

0 comments on commit f01d6e6

Please sign in to comment.