gh --version
# gh version 2.31.0 (2023-06-20)
Describe the bug
- run
gh browse --repo <OWNER_NAME> <FILE_PATH> from a git subdirectory, it messes up the URL
example
# move into a given 'git' repository, for example "cli"
cd cli
# run the gh browse command to open the "README" of "Zotero"
# it works correctly
gh browse --repo zotero/zotero README.md --no-browser
# https://github.com/zotero/zotero/tree/main/README.md
# move one directory level down in your 'git' repo
cd utils/
# run the same command again and notice 'utils' is wrongly placed within the link
gh browse --repo zotero/zotero README.md --no-browser
# https://github.com/zotero/zotero/tree/main/utils/README.md
bisect
# 70c78f2aa896f2c6baf9a045c087f1042fd4b62d is the first bad commit
# commit 70c78f2aa896f2c6baf9a045c087f1042fd4b62d
# Author: nate smith <vilmibm@github.com>
# Date: Thu Oct 14 17:07:51 2021 -0500
# some fixes, streamlining
# pkg/cmd/browse/browse.go | 56 ++++++++++-------------------
# pkg/cmd/browse/browse_test.go | 82 +++++++++++++------------------------------
# 2 files changed, 43 insertions(+), 95 deletions(-)
gh --version # gh version 2.31.0 (2023-06-20)Describe the bug
gh browse --repo <OWNER_NAME> <FILE_PATH>from a git subdirectory, it messes up the URLexample
bisect