mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
fix bug when push a branch name with / & fix an integration test bug (#1689)
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
// GetProtectedBranchBy get protected branch information
|
||||
func GetProtectedBranchBy(ctx *macaron.Context) {
|
||||
repoID := ctx.ParamsInt64(":id")
|
||||
branchName := ctx.Params(":branch")
|
||||
branchName := ctx.Params("*")
|
||||
protectBranch, err := models.GetProtectedBranchBy(repoID, branchName)
|
||||
if err != nil {
|
||||
ctx.JSON(500, map[string]interface{}{
|
||||
|
@@ -42,6 +42,6 @@ func RegisterRoutes(m *macaron.Macaron) {
|
||||
m.Group("/", func() {
|
||||
m.Post("/ssh/:id/update", UpdatePublicKey)
|
||||
m.Post("/push/update", PushUpdate)
|
||||
m.Get("/branch/:id/:branch", GetProtectedBranchBy)
|
||||
m.Get("/branch/:id/*", GetProtectedBranchBy)
|
||||
}, CheckInternalToken)
|
||||
}
|
||||
|
Reference in New Issue
Block a user