Merge pull request 'Do not update PRs based on events that happened before they existed' (#2932) from earl-warren/forgejo:wip-superfluous into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2932
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-04-11 12:07:07 +00:00
commit ad8a3ed2a1
18 changed files with 426 additions and 100 deletions

View file

@ -7,6 +7,7 @@ import (
"fmt"
"net/http"
"strconv"
"time"
git_model "code.gitea.io/gitea/models/git"
issues_model "code.gitea.io/gitea/models/issues"
@ -71,6 +72,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
PusherName: opts.UserName,
RepoUserName: ownerName,
RepoName: repoName,
TimeNano: time.Now().UnixNano(),
}
updates = append(updates, option)
if repo.IsEmpty && (refFullName.BranchName() == "master" || refFullName.BranchName() == "main") {