diff options
author | zeripath <art27@cantab.net> | 2021-09-14 17:16:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 18:16:40 +0200 |
commit | 26ef180f466046f9cfab87eea5ea93f5d6da6998 (patch) | |
tree | e4584497cf8bc64f572dcaa49ff1a4c4cb9bd62d /models/repo.go | |
parent | 04b233e9408296fa14eb7623b7dbe0d98c1865f1 (diff) | |
download | gitea-26ef180f466046f9cfab87eea5ea93f5d6da6998.tar.gz gitea-26ef180f466046f9cfab87eea5ea93f5d6da6998.zip |
Correctly rollback in ForkRepository (#17034)
The rollback functionality in
services/repository/repository.go:ForkRepository is incorrect and could
lead to a deadlock as it uses DeleteRepository to delete the rolled-back
repository - a function which creates its own transaction.
This PR adjusts the rollback function to only use RemoveAll as any
database changes will be automatically rolled-back. It also handles
panics and adjusts the Close within WithTx to ensure that if there is a
panic the session will always be closed.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models/repo.go')
0 files changed, 0 insertions, 0 deletions