mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Backport #34370 by @GWDx 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 Co-authored-by: GWDx <gwdx@mail.ustc.edu.cn>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user