summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorMikael Elkiaer <2102306+MikaelElkiaer@users.noreply.github.com>2022-01-10 20:13:38 +0100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-25 23:23:55 +1100
commitae18ad5b66e4085e9592f3fdd96b51d42b496034 (patch)
treec8b2a66c6ca5d190fc9096ffb65bd0abb7a305f8 /pkg/commands
parentb70075eba685c8e90322c24fc28ef90c3c13f220 (diff)
add URL encoding in pull request branch names
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/hosting_service/hosting_service.go5
1 files 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
}
}