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/convert
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
..
activity.go Fix `Permission` in API returned repository struct (#25388) 1 year ago
attachment.go Move `convert` package to services (#22264) 2 years ago
convert.go Sync branches into databases (#22743) 1 year ago
git_commit.go Filter get single commit (#24613) 1 year ago
git_commit_test.go Move `convert` package to services (#22264) 2 years ago
issue.go Add the ability to pin Issues (#24406) 1 year ago
issue_comment.go Store and use seconds for timeline time comments (#25392) 1 year ago
issue_test.go Move `convert` package to services (#22264) 2 years ago
main_test.go Move `convert` package to services (#22264) 2 years ago
mirror.go Fix SyncOnCommit always return false in API of push_mirrors (#23088) 1 year ago
notification.go Fix `Permission` in API returned repository struct (#25388) 1 year ago
package.go Fix `Permission` in API returned repository struct (#25388) 1 year ago
pull.go Fix `Permission` in API returned repository struct (#25388) 1 year ago
pull_review.go Add context cache as a request level cache (#22294) 1 year ago
pull_test.go Fix `Permission` in API returned repository struct (#25388) 1 year ago
release.go Add context cache as a request level cache (#22294) 1 year ago
repository.go Fix `Permission` in API returned repository struct (#25388) 1 year ago
status.go Add context cache as a request level cache (#22294) 1 year ago
user.go Add context cache as a request level cache (#22294) 1 year ago
user_test.go Add context cache as a request level cache (#22294) 1 year ago
utils.go Move `convert` package to services (#22264) 2 years ago
utils_test.go Rewrite queue (#24505) 1 year ago
wiki.go Make wiki title supports dashes and improve wiki name related features (#24143) 1 year ago