profclems / glab

The GitLab CLI tool. Archived: now officially adopted by GitLab as the official CLI tool and maintained at https://gitlab.com/gitlab-org/cli. See https://github.com/profclems/glab/issues/983
https://glab.readthedocs.io/
MIT License
2.08k stars 163 forks source link

Missing URL-encoding for branches. #948

Open clemsbot opened 2 years ago

clemsbot commented 2 years ago

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

  1. cd into a git repo.
  2. Create a branch that includes a character that needs url-encoding such as #.
  3. Run glab repo view --web.
  4. See error

Logs

no logs

Your Environment


Last updated: 2022-01-31T20:01:20.065Z

https://gitlab.com/profclems/glab/-/issues/279

clemsbot commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. We haven't had the time to address it yet, but we want to keep it open. This message is just a reminder for us to help triage issues.