forgejo/routers/api/v1/repo
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
..
blob.go
branch.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
collaborators.go Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
commits.go Filter get single commit (#24613) 2023-05-10 09:34:07 +08:00
file.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
fork.go Fix Permission in API returned repository struct (#25388) 2023-06-22 13:08:08 +00:00
git_hook.go
git_ref.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
hook.go Fix Permission in API returned repository struct (#25388) 2023-06-22 13:08:08 +00:00
hook_test.go Refactor web package and context package (#25298) 2023-06-18 09:59:09 +02:00
issue.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
issue_attachment.go
issue_comment.go Use CommentList instead of []*Comment (#24828) 2023-05-21 20:48:28 +08:00
issue_comment_attachment.go
issue_dependency.go
issue_label.go
issue_pin.go Followup to pinned Issues (#24945) 2023-05-30 15:26:51 +00:00
issue_reaction.go
issue_stopwatch.go
issue_subscription.go
issue_tracked_time.go Decouple the different contexts from each other (#24786) 2023-05-21 09:50:53 +08:00
key.go Fix Permission in API returned repository struct (#25388) 2023-06-22 13:08:08 +00:00
label.go
language.go
main_test.go
migrate.go Fix Permission in API returned repository struct (#25388) 2023-06-22 13:08:08 +00:00
milestone.go
mirror.go Use correct response code in push mirror creation response in v1_json.tmpl (#25476) 2023-06-28 22:00:19 +00:00
notes.go Filters for GetAllCommits (#24568) 2023-05-09 09:06:05 +08:00
patch.go Sync branches into databases (#22743) 2023-06-29 10:03:20 +00:00
pull.go Filters for GetAllCommits (#24568) 2023-05-09 09:06:05 +08:00
pull_review.go
release.go
release_attachment.go
release_tags.go
repo.go Fix Permission in API returned repository struct (#25388) 2023-06-22 13:08:08 +00:00
repo_test.go Refactor web package and context package (#25298) 2023-06-18 09:59:09 +02:00
star.go
status.go Fix Permission in API returned repository struct (#25388) 2023-06-22 13:08:08 +00:00
subscriber.go
tag.go
teams.go
topic.go
transfer.go Fix Permission in API returned repository struct (#25388) 2023-06-22 13:08:08 +00:00
tree.go
wiki.go