Fix `glab repo view` handling of branches
Description
This does fix a few things in glab repo view
command:
- Uses provided
-b branchname
to also retrieve the README file. - Only override an empty
opts.Branch
when a repository is not provided as argument - The generated URL for opening in a browser only appends
/-/tree/
when provided branch is not an empty string
Related Issue Resolves #786 (closed)
How Has This Been Tested?
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)