You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules/repository
zeripath 270c7f36db
Correctly rollback in ForkRepository (#17034) (#17045)
Backport #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>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago
..
adopt.go Fix various documentation, user-facing, and source comment typos (#16367) 4 years ago
archive.go Fix archive error when rename repo or user (#16399) 4 years ago
branch.go [API] Add pagination to ListBranches (#14524) 4 years ago
cache.go Make commit info cancelable (#16032) 4 years ago
check.go Update repository size on cron gc task (#15177) 4 years ago
commits.go Report the correct number of pushes on the feeds (#16811) (#16822) 3 years ago
commits_test.go Implemented head_commit for webhooks (#16282) 4 years ago
create.go Check if label template exist first (#14384) 4 years ago
create_test.go Fixed assert statements. (#16089) 4 years ago
fork.go Correctly rollback in ForkRepository (#17034) (#17045) 3 years ago
fork_test.go Move create/fork repository from models to modules/repository (#9489) 5 years ago
generate.go Ensure that HEAD is updated to match default branch in template generation (#13948) 4 years ago
hooks.go Set GIT_DIR correctly if it is not set (#15751) 4 years ago
init.go [API] Add pagination to ListBranches (#14524) 4 years ago
main_test.go Move push commits from models to modules/repository (#9370) 5 years ago
push.go Fix a bug on refactoring (#13373) 4 years ago
repo.go Add push to remote mirror repository (#15157) 4 years ago
update.go Move PushUpdateAddDeleteTags to repository module from models (#10106) 5 years ago