glab repo view has issues detecting and handling branches
Description
In https://github.com/profclems/glab/pull/778 I've submitted the implementation for glab repo view
command. It seems there is still some fixes to get branches handling correctly.
Expected Behavior vs Actual Behavior There are two problems I found:
- When using
glab repo view myrepository --web
it will use current repository's branch name instead of the default one from the API request - If I specify
-b custombranch
it is only used for opening a repository with--web
, and not for fetching the README file.
Possible Fix
Steps to Reproduce
-
cd
into a repository, switch to some non-default branch name (like:this-is-a-test
) glab repo view profclems/glab --web
- You will be redirected to
https://gitlab.com/profclems/glab/-/tree/this-is-a-test
Logs
Your Environment
- Version used (Run
glab --version
): - Operating System and version: