diff options
Diffstat (limited to 'modules/private')
-rw-r--r-- | modules/private/branch.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/private/branch.go b/modules/private/branch.go index b6b119e871..bbd0d4b697 100644 --- a/modules/private/branch.go +++ b/modules/private/branch.go @@ -7,17 +7,17 @@ package private import ( "encoding/json" "fmt" - "net/url" "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/util" ) // GetProtectedBranchBy get protected branch information func GetProtectedBranchBy(repoID int64, branchName string) (*models.ProtectedBranch, error) { // Ask for running deliver hook and test pull request tasks. - reqURL := setting.LocalURL + fmt.Sprintf("api/internal/branch/%d/%s", repoID, url.PathEscape(branchName)) + reqURL := setting.LocalURL + fmt.Sprintf("api/internal/branch/%d/%s", repoID, util.PathEscapeSegments(branchName)) log.GitLogger.Trace("GetProtectedBranchBy: %s", reqURL) resp, err := newInternalRequest(reqURL, "GET").Response() |