Skip to content

fix(repo): URL encode branch name when viewing on web

Patrick Bajao requested to merge 948-fix-project-view-web-branch into main

Description

Before this fix, when a branch name has some characters that need to be URL encoded when viewed via a browser, it'll be opened as is without any URL encoding.

To fix that, url.PathEscape is called on branch name before it is appended to the URL to be opened.

Related Issues

Resolves #948 (closed)

How has this been tested?

Checkout https://gitlab.com/patrickbajao/cli-test/-/tree/%23branch-name and run glab repo view --web and it should open the branch on your browser.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
Edited by Patrick Bajao

Merge request reports