mirror of
https://github.com/go-gitea/gitea
synced 2024-11-15 22:54:24 +00:00
534917d576
Fix #22066 # Purpose This PR fix the releases will be deleted when mirror repository sync the tags. # The problem In the previous implementation of #19125. All releases record in databases of one mirror repository will be deleted before sync. Ref: https://github.com/go-gitea/gitea/pull/19125/files#diff-2aa04998a791c30e5a02b49a97c07fcd93d50e8b31640ce2ddb1afeebf605d02R481 # The Pros This PR introduced a new method which will load all releases from databases and all tags on git data into memory. And detect which tags needs to be inserted, which tags need to be updated or deleted. Only tags releases(IsTag=true) which are not included in git data will be deleted, only tags which sha1 changed will be updated. So it will not delete any real releases include drafts. # The Cons The drawback is the memory usage will be higher than before if there are many tags on this repository. This PR defined a special release struct to reduce columns loaded from database to memory. |
||
---|---|---|
.. | ||
branch.go | ||
collaborator_test.go | ||
collaborator.go | ||
commits_test.go | ||
commits.go | ||
create_test.go | ||
create.go | ||
delete.go | ||
env.go | ||
fork.go | ||
generate_test.go | ||
generate.go | ||
hooks.go | ||
init_test.go | ||
init.go | ||
license_test.go | ||
license.go | ||
main_test.go | ||
push.go | ||
repo_test.go | ||
repo.go | ||
temp.go |