Branch names should be URL encoded when passing --web flag
Created by: clemsbot
By kaHaleMaKai,
Description
When on a branch that includes character that require url-encoding, they don't get encoded when opening the repo in a browser.
Expected Behavior vs Actual Behavior
E.g. on a branch like #1-this-is-my-first-issue
the opened url should be something like
https://GITLAB_URL/NS/PROJECT/-/tree/%231-my-first-issue
Instead, the browser opens the un-encoded url
https://GITLAB_URL/NS/PROJECT/-/tree/#1-my-first-issue
and fails.
Possible Fix Url-encode the branch name. I haven't checked whether this also applies to issue names, mrs etc.
Steps to Reproduce
-
cd
into a git repo. - Create a branch that includes a character that needs url-encoding such as
#
. - Run
glab repo view --web
. - See error
Logs
no logs
Your Environment
- Version used (Run
glab --version
):1.21.1 (2021-09-28)
- Operating System and version:
debian testing/bookworm
Last updated: 2022-01-31T20:01:20.065Z