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.
Zettat123 9a83aa28a3
Get rules by id when editing branch protection rule (#22932)
When users rename an existing branch protection rule, a new rule with
the new name will be created and the old rule will still exist.

![image](https://user-images.githubusercontent.com/15528715/219276442-d3c001ad-e693-44ec-9ad2-b33f2666b49b.png)

---

![image](https://user-images.githubusercontent.com/15528715/219276478-547c3b93-b3f1-4292-a1ef-c1b7747fe1bb.png)

The reason is that the `SettingsProtectedBranchPost` function only get
branch protection rule by name before updating or creating a rule. When
the rule name changes, the function cannot find the existing rule so it
will create a new rule rather than update the existing rule. To fix the
bug, the function should get rule by id first.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 year ago
..
actions Fix improper HTMLURL usages in Go code (#22839) 1 year ago
activity.go Implement FSFE REUSE for golang files (#21840) 2 years ago
attachment.go Add API management for issue/pull and comment attachments (#21783) 2 years ago
blame.go Add context cache as a request level cache (#22294) 1 year ago
branch.go Supports wildcard protected branch (#20825) 1 year ago
cherry_pick.go Rename almost all Ctx functions (#22071) 2 years ago
commit.go Add context cache as a request level cache (#22294) 1 year ago
compare.go Use beforeCommit instead of baseCommit (#22949) 1 year ago
download.go Use context parameter in models/git (#22367) 1 year ago
editor.go Rename almost all Ctx functions (#22071) 2 years ago
editor_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
find.go Implement FSFE REUSE for golang files (#21840) 2 years ago
http.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 1 year ago
http_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue.go Scoped labels (#22585) 1 year ago
issue_content_history.go Move helpers to be prefixed with `gt-` (#22879) 1 year ago
issue_dependency.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
issue_label.go Scoped labels (#22585) 1 year ago
issue_label_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
issue_lock.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
issue_stopwatch.go Fix improper HTMLURL usages in Go code (#22839) 1 year 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) 1 year ago
issue_watch.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
lfs.go Refactor git command package to improve security and maintainability (#22678) 1 year ago
main_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
middlewares.go Implement FSFE REUSE for golang files (#21840) 2 years ago
migrate.go Implement FSFE REUSE for golang files (#21840) 2 years ago
milestone.go Rename almost all Ctx functions (#22071) 2 years ago
packages.go Use dynamic package type list (#22263) 2 years ago
patch.go Rename almost all Ctx functions (#22071) 2 years ago
projects.go Preview images for Issue cards in Project Board view (#22112) 1 year ago
projects_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
pull.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 1 year ago
pull_review.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
release.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
release_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
render.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
runners.go Implement actions (#21937) 1 year ago
search.go Fix improper HTMLURL usages in Go code (#22839) 1 year ago
setting.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 1 year ago
setting_protected_branch.go Get rules by id when editing branch protection rule (#22932) 1 year ago
setting_secrets.go Add user secrets (#22191) 1 year ago
settings_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
tag.go Add main landmark to templates and adjust titles (#22670) 1 year 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 Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 1 year ago
view_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
webhook.go Add context cache as a request level cache (#22294) 1 year ago
wiki.go Use context parameter in models/git (#22367) 1 year ago
wiki_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago