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.
forgejo/services/migrations
Lunny Xiao 6e19484f4d
Sync branches into databases (#22743)
Related #14180
Related #25233 
Related #22639
Close #19786
Related #12763 

This PR will change all the branches retrieve method from reading git
data to read database to reduce git read operations.

- [x] Sync git branches information into database when push git data
- [x] Create a new table `Branch`, merge some columns of `DeletedBranch`
into `Branch` table and drop the table `DeletedBranch`.
- [x] Read `Branch` table when visit `code` -> `branch` page
- [x] Read `Branch` table when list branch names in `code` page dropdown
- [x] Read `Branch` table when list git ref compare page
- [x] Provide a button in admin page to manually sync all branches.
- [x] Sync branches if repository is not empty but database branches are
empty when visiting pages with branches list
- [x] Use `commit_time desc` as the default FindBranch order by to keep
consistent as before and deleted branches will be always at the end.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
1 year ago
..
codebase.go Rewrite logger system (#24726) 1 year ago
codebase_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
common.go Implement FSFE REUSE for golang files (#21840) 2 years ago
dump.go Sync branches into databases (#22743) 1 year ago
error.go Update github.com/google/go-github to v53 (#25157) 1 year ago
git.go Implement FSFE REUSE for golang files (#21840) 2 years ago
gitbucket.go Rewrite logger system (#24726) 1 year ago
gitea_downloader.go Rewrite logger system (#24726) 1 year ago
gitea_downloader_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
gitea_uploader.go Make repo migration cancelable and fix various bugs (#24605) 1 year ago
gitea_uploader_test.go Some refactors for issues stats (#24793) 1 year ago
github.go Fix panic when migrating a repo from GitHub with issues (#25246) 1 year ago
github_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
gitlab.go GitLab migration: Sanitize response for reaction list (#25054) 1 year ago
gitlab_test.go GitLab migration: Sanitize response for reaction list (#25054) 1 year ago
gogs.go Rewrite logger system (#24726) 1 year ago
gogs_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
http_client.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Scoped labels (#22585) 1 year ago
migrate.go Prevent duplicate labels when importing more than 99 (#22591) 1 year ago
migrate_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
onedev.go Rewrite logger system (#24726) 1 year ago
onedev_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
restore.go Implement FSFE REUSE for golang files (#21840) 2 years ago
update.go Implement FSFE REUSE for golang files (#21840) 2 years ago