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.
gitea/routers/web/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>
2 years ago
..
actions Support downloading raw task logs (#24451) 2 years ago
setting Support configuration variables on Gitea Actions (#24724) 2 years ago
activity.go Implement FSFE REUSE for golang files (#21840) 2 years ago
attachment.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
blame.go Sort repo topic labels by name (#24123) 2 years ago
branch.go Sync branches into databases (#22743) 2 years ago
cherry_pick.go Sync branches into databases (#22743) 2 years ago
commit.go Pass 'not' to commit count (#24473) 2 years ago
compare.go Sync branches into databases (#22743) 2 years ago
download.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
editor.go Sync branches into databases (#22743) 2 years ago
editor_test.go Refactor web package and context package (#25298) 2 years ago
find.go Implement FSFE REUSE for golang files (#21840) 2 years ago
helper.go Add actor and status dropdowns to run list (#25118) 2 years ago
helper_test.go Add actor and status dropdowns to run list (#25118) 2 years ago
http.go Redesign Scoped Access Tokens (#24767) 2 years ago
http_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue.go Sync branches into databases (#22743) 2 years ago
issue_content_history.go Move helpers to be prefixed with `gt-` (#22879) 2 years ago
issue_dependency.go Add API to manage issue dependencies (#17935) 2 years ago
issue_label.go Make label templates have consistent behavior and priority (#23749) 2 years ago
issue_label_test.go Refactor web package and context package (#25298) 2 years ago
issue_lock.go Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380) 2 years ago
issue_pin.go Use fetch form action for lock/unlock/pin/unpin on sidebar (#25380) 2 years ago
issue_stopwatch.go Speed up HasUserStopwatch & GetActiveStopwatch (#23051) 2 years ago
issue_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_timetrack.go Fix improper HTMLURL usages in Go code (#22839) 2 years ago
issue_watch.go Rewrite logger system (#24726) 2 years ago
lfs.go Introduce path Clean/Join helper functions (#23495) 2 years ago
main_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
middlewares.go Show outdated comments in files changed tab (#24936) 2 years ago
migrate.go Make repo migration cancelable and fix various bugs (#24605) 2 years ago
milestone.go Improve Gitea's web context, decouple "issue template" code into service package (#24590) 2 years ago
packages.go Use dynamic package type list (#22263) 2 years ago
patch.go Sync branches into databases (#22743) 2 years ago
projects.go Improve loadprojects for issue list (#25468) 2 years ago
projects_test.go Refactor web package and context package (#25298) 2 years ago
pull.go Sync branches into databases (#22743) 2 years ago
pull_review.go Show outdated comments in files changed tab (#24936) 2 years ago
release.go Add actor and status dropdowns to run list (#25118) 2 years ago
release_test.go Refactor web package and context package (#25298) 2 years ago
render.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Fix all possible setting error related storages and added some tests (#23911) 2 years ago
search.go Refactor indexer (#25174) 2 years ago
setting.go Hide 'Mirror Settings' when unneeded, improve hints (#24433) 2 years ago
setting_protected_branch.go Sync branches into databases (#22743) 2 years ago
settings_test.go Refactor web package and context package (#25298) 2 years ago
tag.go Add main landmark to templates and adjust titles (#22670) 2 years ago
topic.go Implement FSFE REUSE for golang files (#21840) 2 years ago
treelist.go Implement FSFE REUSE for golang files (#21840) 2 years ago
view.go Show if File is Executable (#25287) 2 years ago
view_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
webhook.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
wiki.go Improve wiki sidebar and TOC (#25460) 2 years ago
wiki_test.go Refactor web package and context package (#25298) 2 years ago