forgejo/models/git
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>
2023-06-29 10:03:20 +00:00
..
branch.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
branch_list.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
branch_test.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
commit_status.go Fix index generation parallelly failure (#25235) 2023-06-15 02:14:43 +02:00
commit_status_test.go Use context parameter in models/git (#22367) 2023-01-09 11:50:54 +08:00
lfs.go Fix missed table name on iterate lfs meta objects (#24768) 2023-05-17 23:51:22 +08:00
lfs_lock.go Introduce path Clean/Join helper functions (#23495) 2023-03-21 16:02:49 -04:00
main_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
protected_banch_list_test.go Fix branch protection priority (#24045) 2023-04-11 13:22:49 -04:00
protected_branch.go Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
protected_branch_list.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
protected_branch_test.go Supports wildcard protected branch (#20825) 2023-01-16 16:00:22 +08:00
protected_tag.go Use context parameter in models/git (#22367) 2023-01-09 11:50:54 +08:00
protected_tag_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00