From ec2aa13165e4caed41e2bab0b6a8cc661f952d0d Mon Sep 17 00:00:00 2001 From: Soule BA Date: Thu, 8 Sep 2022 14:51:39 +0200 Subject: [PATCH] Make sure we reconcile with the right reconciliation method Signed-off-by: Soule BA --- internal/bootstrap/bootstrap_provider.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/internal/bootstrap/bootstrap_provider.go b/internal/bootstrap/bootstrap_provider.go index 5d57d4e9..229056af 100644 --- a/internal/bootstrap/bootstrap_provider.go +++ b/internal/bootstrap/bootstrap_provider.go @@ -298,11 +298,8 @@ func (b *GitProviderBootstrapper) reconcileOrgRepository(ctx context.Context) (g var changed bool if b.reconcile { - // Set default branch before calling Reconcile due to bug described - // above. - repoInfo.DefaultBranch = repo.Get().DefaultBranch if err = retry(1, 2*time.Second, func() (err error) { - repo, changed, err = b.provider.OrgRepositories().Reconcile(ctx, repoRef, repoInfo) + changed, err = repo.Reconcile(ctx) return }); err != nil { return nil, fmt.Errorf("failed to reconcile Git repository %q: %w", repoRef.String(), err) @@ -373,12 +370,9 @@ func (b *GitProviderBootstrapper) reconcileUserRepository(ctx context.Context) ( } if b.reconcile { - // Set default branch before calling Reconcile due to bug described - // above. - repoInfo.DefaultBranch = repo.Get().DefaultBranch var changed bool if err = retry(1, 2*time.Second, func() (err error) { - repo, changed, err = b.provider.UserRepositories().Reconcile(ctx, repoRef, repoInfo) + changed, err = repo.Reconcile(ctx) return }); err != nil { return nil, fmt.Errorf("failed to reconcile Git repository %q: %w", repoRef.String(), err)