1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-22 08:42:32 -05:00
forgejo/services/pull
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
..
check.go Improve queue and logger context (#24924) 2023-05-26 07:31:55 +00:00
check_test.go Improve queue and logger context (#24924) 2023-05-26 07:31:55 +00:00
comment.go Make more functions use ctx instead of db.DefaultContext (#24068) 2023-04-14 14:18:28 -04:00
commit_status.go Support for status check pattern (#24633) 2023-05-17 16:11:13 +08:00
edits.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
lfs.go Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00
main_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
merge.go Merge message template support for rebase without merge commit (#22669) 2023-05-22 09:01:46 +08:00
merge_merge.go Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00
merge_prepare.go Refactor merge/update git command calls (#23366) 2023-03-09 09:48:52 -06:00
merge_rebase.go Merge message template support for rebase without merge commit (#22669) 2023-05-22 09:01:46 +08:00
merge_squash.go Improve squash merge commit author and co-author with private emails (#22977) 2023-03-09 22:17:04 -05:00
merge_test.go Support template for merge message description (#22248) 2022-12-29 14:40:20 +02:00
patch.go Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00
patch_unmerged.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
pull.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
pull_test.go Support template for merge message description (#22248) 2022-12-29 14:40:20 +02:00
review.go Make more functions use ctx instead of db.DefaultContext (#24068) 2023-04-14 14:18:28 -04:00
temp_repo.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
update.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
update_rebase.go Refactor and tidy-up the merge/update branch code (#22568) 2023-03-07 15:07:35 -05:00