mirror of
https://github.com/go-gitea/gitea
synced 2025-07-14 22:47:21 +00:00
Fix a branch divergence cache bug (#31659)
Fix #31599 A branch divergence is counted based on the default branch. If the default branch is updated, all divergence caches of the repo need to be deleted.
This commit is contained in:
@ -221,8 +221,14 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
|
||||
}
|
||||
|
||||
// delete cache for divergence
|
||||
if err := DelDivergenceFromCache(repo.ID, branch); err != nil {
|
||||
log.Error("DelDivergenceFromCache: %v", err)
|
||||
if branch == repo.DefaultBranch {
|
||||
if err := DelRepoDivergenceFromCache(ctx, repo.ID); err != nil {
|
||||
log.Error("DelRepoDivergenceFromCache: %v", err)
|
||||
}
|
||||
} else {
|
||||
if err := DelDivergenceFromCache(repo.ID, branch); err != nil {
|
||||
log.Error("DelDivergenceFromCache: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
commits := repo_module.GitToPushCommits(l)
|
||||
|
Reference in New Issue
Block a user