diff options
Diffstat (limited to 'cmd/hook.go')
-rw-r--r-- | cmd/hook.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/hook.go b/cmd/hook.go index bde449ccdc..d3a1a56b01 100644 --- a/cmd/hook.go +++ b/cmd/hook.go @@ -8,7 +8,6 @@ import ( "bufio" "bytes" "fmt" - "net/url" "os" "strconv" "strings" @@ -18,6 +17,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/private" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/util" "github.com/urfave/cli" ) @@ -239,7 +239,7 @@ func runHookPostReceive(c *cli.Context) error { branch = fmt.Sprintf("%s:%s", repo.OwnerName, branch) } fmt.Fprintf(os.Stderr, "Create a new pull request for '%s':\n", branch) - fmt.Fprintf(os.Stderr, " %s/compare/%s...%s\n", baseRepo.HTMLURL(), url.QueryEscape(baseRepo.DefaultBranch), url.QueryEscape(branch)) + fmt.Fprintf(os.Stderr, " %s/compare/%s...%s\n", baseRepo.HTMLURL(), util.PathEscapeSegments(baseRepo.DefaultBranch), util.PathEscapeSegments(branch)) } else { fmt.Fprint(os.Stderr, "Visit the existing pull request:\n") fmt.Fprintf(os.Stderr, " %s/pulls/%d\n", baseRepo.HTMLURL(), pr.Index) |