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/models
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
..
actions Fix content holes in Actions task logs file (#25560) 1 year ago
activities Use a separate admin page to show global stats, remove `actions` stat (#25062) 1 year ago
admin Make repo migration cancelable and fix various bugs (#24605) 1 year ago
asymkey Merge setting.InitXXX into one function with options (#24389) 1 year ago
auth Add ability to set multiple redirect URIs in OAuth application UI (#25072) 1 year ago
avatars Avoid warning for system setting when start up (#23054) 1 year ago
db Split lfs size from repository size (#22900) 1 year ago
dbfs Fix content holes in Actions task logs file (#25560) 1 year ago
fixtures Sync branches into databases (#22743) 1 year ago
git Sync branches into databases (#22743) 1 year ago
issues Improve loadprojects for issue list (#25468) 1 year ago
migrations Sync branches into databases (#22743) 1 year ago
organization Use RepositoryList instead of []*Repository (#25074) 1 year ago
packages Hide limited users if viewed by anonymous ghost (#25214) 1 year ago
perm Rewrite logger system (#24726) 1 year ago
project Improve GetBoards and getDefaultBoard (#22981) 1 year ago
pull refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo Split lfs size from repository size (#22900) 1 year ago
secret Support configuration variables on Gitea Actions (#24724) 1 year ago
shared/types Display owner of a runner as a tooltip instead of static text (#24377) 1 year ago
system Avoid warning for system setting when start up (#23054) 1 year ago
unit Rewrite logger system (#24726) 1 year ago
unittest Refactor path & config system (#25330) 1 year ago
user Sync branches into databases (#22743) 1 year ago
webhook New webhook trigger for receiving Pull Request review requests (#24481) 1 year ago
error.go Sync branches into databases (#22743) 1 year ago
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Merge setting.InitXXX into one function with options (#24389) 1 year ago
migrate.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
migrate_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
org.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
org_team.go Remove org users who belong to no teams (#24247) 1 year ago
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Sync branches into databases (#22743) 1 year ago
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 1 year ago
repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_transfer.go Fix unclear `IsRepositoryExist` logic (#24374) 1 year ago
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2 years ago