1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-28 05:08:37 +00:00

Fix incorrect divergence cache after switching default branch (#34370)

Issue: After switching the default branch, other branches are still
compared against the old default branch due to outdated divergence
cache.

Change: Clear the divergence cache in SetRepoDefaultBranch to ensure
correct comparisons against the new default branch.

Fixes #34369
This commit is contained in:
GWDx
2025-05-09 02:00:29 +08:00
committed by GitHub
parent 4c611bf280
commit 71a1187209
3 changed files with 105 additions and 3 deletions

View File

@@ -663,6 +663,11 @@ func SetRepoDefaultBranch(ctx context.Context, repo *repo_model.Repository, newB
}
}
// clear divergence cache
if err := DelRepoDivergenceFromCache(ctx, repo.ID); err != nil {
log.Error("DelRepoDivergenceFromCache: %v", err)
}
notify_service.ChangeDefaultBranch(ctx, repo)
return nil