1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Use *PushUpdateOptions as receiver (#17724)

This commit is contained in:
Gusted
2021-11-24 09:08:13 +00:00
committed by GitHub
parent c97d66d23c
commit 4e7ca946da
2 changed files with 17 additions and 17 deletions

View File

@@ -57,7 +57,7 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
wasEmpty = repo.IsEmpty
}
option := repo_module.PushUpdateOptions{
option := &repo_module.PushUpdateOptions{
RefFullName: refFullName,
OldCommitID: opts.OldCommitIDs[i],
NewCommitID: opts.NewCommitIDs[i],
@@ -66,11 +66,11 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
RepoUserName: ownerName,
RepoName: repoName,
}
updates = append(updates, &option)
updates = append(updates, option)
if repo.IsEmpty && option.IsBranch() && (option.BranchName() == "master" || option.BranchName() == "main") {
// put the master/main branch first
copy(updates[1:], updates)
updates[0] = &option
updates[0] = option
}
}
}