aboutsummaryrefslogtreecommitdiffstats
path: root/models/git/protected_branch_list.go
Commit message (Collapse)AuthorAgeFilesLines
* Start to migrate from `util.OptionalBool` to `optional.Option[bool]` (#29329)65432024-02-231-2/+2
| | | just create transition helper and migrate two structs
* Sync branches into databases (#22743)Lunny Xiao2023-06-291-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix branch protection priority (#24045)Lunny Xiao2023-04-111-7/+3
| | | Fix #24044
* Supports wildcard protected branch (#20825)Lunny Xiao2023-01-161-0/+86
This PR introduce glob match for protected branch name. The separator is `/` and you can use `*` matching non-separator chars and use `**` across separator. It also supports input an exist or non-exist branch name as matching condition and branch name condition has high priority than glob rule. Should fix #2529 and #15705 screenshots <img width="1160" alt="image" src="https://user-images.githubusercontent.com/81045/205651179-ebb5492a-4ade-4bb4-a13c-965e8c927063.png"> Co-authored-by: zeripath <art27@cantab.net>