mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-14 10:03:59 +01:00
add extra transaction wrap
This was already called from within a transaction, but never know about future callers
This commit is contained in:
parent
7e7ac0dbf2
commit
24c91d8248
@ -104,6 +104,7 @@ func GetForksByUserAndOrgs(ctx context.Context, user *user_model.User, repo *Rep
|
||||
|
||||
// ReparentFork sets the fork to be an unforked repository and the forked repo becomes its fork
|
||||
func ReparentFork(ctx context.Context, forkedRepoID, srcForkID int64) error {
|
||||
return db.WithTx(ctx, func(ctx context.Context) error {
|
||||
if _, err := db.GetEngine(ctx).Table("repository").ID(srcForkID).Cols("fork_id", "is_fork").Update(&Repository{ForkID: forkedRepoID, IsFork: true}); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -111,4 +112,5 @@ func ReparentFork(ctx context.Context, forkedRepoID, srcForkID int64) error {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user