[ACTIONS] port scheduled actions from Gitea

Refs: https://codeberg.org/forgejo/forgejo/issues/2798
This commit is contained in:
Earl Warren 2024-03-25 16:54:38 +01:00
parent 52e9d2db06
commit a117dfd2b1
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 6 additions and 7 deletions

View file

@ -381,7 +381,7 @@ func RenameBranch(ctx context.Context, repo *repo_model.Repository, doer *user_m
log.Error("CancelPreviousJobs: %v", err)
}
err2 = gitRepo.SetDefaultBranch(ctx, repo, to)
err2 = gitrepo.SetDefaultBranch(ctx, repo, to)
if err2 != nil {
return err2
}
@ -546,7 +546,7 @@ func SetRepoDefaultBranch(ctx context.Context, repo *repo_model.Repository, gitR
log.Error("CancelPreviousJobs: %v", err)
}
if err := gitRepo.SetDefaultBranch(newBranchName); err != nil {
if err := gitrepo.SetDefaultBranch(ctx, repo, newBranchName); err != nil {
if !git.IsErrUnsupportedVersion(err) {
return err
}