forgejo/routers/web/repo
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>
2023-02-20 19:30:41 +08:00
..
actions Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
activity.go
attachment.go
blame.go Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
branch.go
cherry_pick.go
commit.go Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
compare.go Use beforeCommit instead of baseCommit (#22949) 2023-02-20 11:56:07 +08:00
download.go
editor.go
editor_test.go
find.go
http.go Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
http_test.go
issue.go Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
issue_content_history.go Move helpers to be prefixed with gt- (#22879) 2023-02-13 17:59:59 +00:00
issue_dependency.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
issue_label.go Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
issue_label_test.go
issue_lock.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
issue_stopwatch.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
issue_test.go
issue_timetrack.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
issue_watch.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
lfs.go
main_test.go
middlewares.go
migrate.go
milestone.go
packages.go
patch.go
projects.go Preview images for Issue cards in Project Board view (#22112) 2023-02-11 16:12:41 +08:00
projects_test.go
pull.go Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
pull_review.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
release.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
release_test.go
render.go
repo.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
runners.go
search.go Fix improper HTMLURL usages in Go code (#22839) 2023-02-11 14:34:11 +08:00
setting.go Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
setting_protected_branch.go Get rules by id when editing branch protection rule (#22932) 2023-02-20 19:30:41 +08:00
setting_secrets.go
settings_test.go
tag.go
topic.go
treelist.go
view.go Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
view_test.go
webhook.go Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
wiki.go
wiki_test.go