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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}
}
}