aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-08-28 12:06:47 +0800
committerGitHub <noreply@github.com>2023-08-28 04:06:47 +0000
commit6945918d34ecc855c99bfc7d7773c3a2d60a3565 (patch)
treea3e35b0adc780ae951d35351d79695551e6dfc5c /modules
parent67daa7bcb0cfd3cd7e5efa8667021a7e422f4bdf (diff)
downloadgitea-6945918d34ecc855c99bfc7d7773c3a2d60a3565.tar.gz
gitea-6945918d34ecc855c99bfc7d7773c3a2d60a3565.zip
Fix bug for ctx usage (#26762)
Regression from #26158 Fix #26684
Diffstat (limited to 'modules')
-rw-r--r--modules/repository/branch.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/repository/branch.go b/modules/repository/branch.go
index bffadd62f4..8daceecb44 100644
--- a/modules/repository/branch.go
+++ b/modules/repository/branch.go
@@ -106,15 +106,15 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
return int64(len(allBranches)), nil
}
- if err := db.WithTx(ctx, func(subCtx context.Context) error {
+ if err := db.WithTx(ctx, func(ctx context.Context) error {
if len(toAdd) > 0 {
- if err := git_model.AddBranches(subCtx, toAdd); err != nil {
+ if err := git_model.AddBranches(ctx, toAdd); err != nil {
return err
}
}
for _, b := range toUpdate {
- if _, err := db.GetEngine(subCtx).ID(b.ID).
+ if _, err := db.GetEngine(ctx).ID(b.ID).
Cols("commit_id, commit_message, pusher_id, commit_time, is_deleted").
Update(b); err != nil {
return err
@@ -122,7 +122,7 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
}
if len(toRemove) > 0 {
- if err := git_model.DeleteBranches(subCtx, repo.ID, doerID, toRemove); err != nil {
+ if err := git_model.DeleteBranches(ctx, repo.ID, doerID, toRemove); err != nil {
return err
}
}