diff --git a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala index e35741e..a05dff2 100644 --- a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala @@ -177,9 +177,10 @@ }) /** Branch protection for branch */ - get("/:owner/:repository/settings/branches/:branch")(ownerOnly { repository => + get("/:owner/:repository/settings/branches/*")(ownerOnly { repository => import gitbucket.core.api._ - val branch = params("branch") + val branch = params("splat") + if (!repository.branchList.contains(branch)) { redirect(s"/${repository.owner}/${repository.name}/settings/branches") } else {