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/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>
2 years ago
..
blob.go Implement FSFE REUSE for golang files (#21840) 2 years ago
branch.go Sync branches into databases (#22743) 2 years ago
collaborators.go Add context cache as a request level cache (#22294) 2 years ago
commits.go Filter get single commit (#24613) 2 years ago
file.go Sync branches into databases (#22743) 2 years ago
fork.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
git_hook.go Move `convert` package to services (#22264) 2 years ago
git_ref.go Implement FSFE REUSE for golang files (#21840) 2 years ago
hook.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
hook_test.go Refactor web package and context package (#25298) 2 years ago
issue.go Decouple the different contexts from each other (#24786) 2 years ago
issue_attachment.go Preserve file size when creating attachments (#23406) 2 years ago
issue_comment.go Use `CommentList` instead of `[]*Comment` (#24828) 2 years ago
issue_comment_attachment.go Preserve file size when creating attachments (#23406) 2 years ago
issue_dependency.go Add API to manage issue dependencies (#17935) 2 years ago
issue_label.go Move `convert` package to services (#22264) 2 years ago
issue_pin.go Followup to pinned Issues (#24945) 2 years ago
issue_reaction.go Add context cache as a request level cache (#22294) 2 years ago
issue_stopwatch.go Move `convert` package to services (#22264) 2 years ago
issue_subscription.go Add context cache as a request level cache (#22294) 2 years ago
issue_tracked_time.go Decouple the different contexts from each other (#24786) 2 years ago
key.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
label.go Add loading yaml label template files (#22976) 2 years ago
language.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Merge setting.InitXXX into one function with options (#24389) 2 years ago
migrate.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
milestone.go Move `convert` package to services (#22264) 2 years ago
mirror.go Use correct response code in push mirror creation response in v1_json.tmpl (#25476) 2 years ago
notes.go Filters for GetAllCommits (#24568) 2 years ago
patch.go Sync branches into databases (#22743) 2 years ago
pull.go Filters for GetAllCommits (#24568) 2 years ago
pull_review.go Make more functions use ctx instead of db.DefaultContext (#24068) 2 years ago
release.go Add context cache as a request level cache (#22294) 2 years ago
release_attachment.go Preserve file size when creating attachments (#23406) 2 years ago
release_tags.go Add context cache as a request level cache (#22294) 2 years ago
repo.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
repo_test.go Refactor web package and context package (#25298) 2 years ago
star.go Add context cache as a request level cache (#22294) 2 years ago
status.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
subscriber.go Add context cache as a request level cache (#22294) 2 years ago
tag.go Add context cache as a request level cache (#22294) 2 years ago
teams.go Add context cache as a request level cache (#22294) 2 years ago
topic.go Move `convert` package to services (#22264) 2 years ago
transfer.go Fix `Permission` in API returned repository struct (#25388) 2 years ago
tree.go Implement FSFE REUSE for golang files (#21840) 2 years ago
wiki.go Pass 'not' to commit count (#24473) 2 years ago