From ae18ad5b66e4085e9592f3fdd96b51d42b496034 Mon Sep 17 00:00:00 2001 From: Mikael Elkiaer <2102306+MikaelElkiaer@users.noreply.github.com> Date: Mon, 10 Jan 2022 20:13:38 +0100 Subject: [PATCH] add URL encoding in pull request branch names --- pkg/commands/hosting_service/hosting_service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/commands/hosting_service/hosting_service.go b/pkg/commands/hosting_service/hosting_service.go index 3fd2a7bd6..e054b01b8 100644 --- a/pkg/commands/hosting_service/hosting_service.go +++ b/pkg/commands/hosting_service/hosting_service.go @@ -4,6 +4,7 @@ import ( "fmt" "regexp" "strings" + "net/url" "github.com/go-errors/errors" "github.com/jesseduffield/lazygit/pkg/i18n" @@ -42,9 +43,9 @@ func (self *HostingServiceMgr) GetPullRequestURL(from string, to string) (string } if to == "" { - return gitService.getPullRequestURLIntoDefaultBranch(from), nil + return gitService.getPullRequestURLIntoDefaultBranch(url.QueryEscape(from)), nil } else { - return gitService.getPullRequestURLIntoTargetBranch(from, to), nil + return gitService.getPullRequestURLIntoTargetBranch(url.QueryEscape(from), url.QueryEscape(to)), nil } }