mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09: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:
1 parent
03c8c2683c
commit
e9aa39bda4
2 files changed
+25
-2
No files matched your search
@@ -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