Skip to content

Commit 60b2092

Browse files
committed
Fix reset commit count after PR merge
1 parent 552530d commit 60b2092

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/pull.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616

1717
"code.gitea.io/git"
1818
"code.gitea.io/gitea/modules/base"
19+
"code.gitea.io/gitea/modules/cache"
1920
"code.gitea.io/gitea/modules/log"
2021
"code.gitea.io/gitea/modules/process"
2122
"code.gitea.io/gitea/modules/setting"
@@ -416,6 +417,9 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle
416417
log.Error(4, "MergePullRequestAction [%d]: %v", pr.ID, err)
417418
}
418419

420+
// Reset cached commit count
421+
cache.Remove(pr.Issue.Repo.GetCommitsCountCacheKey(pr.BaseBranch, true))
422+
419423
// Reload pull request information.
420424
if err = pr.LoadAttributes(); err != nil {
421425
log.Error(4, "LoadAttributes: %v", err)

0 commit comments

Comments
 (0)