This commit adjusts the fetching remote function to also consider
default repositories set by the gh cli. When the local git repository
has remote.origin.gh-resolved pwntester/octo.nvim set, the resolved
repository name will be used instead of the default one.
When attempting to run any gh cli commands in a repo where there are multiple
remotes defined, it requires the user to set the default repo to use via gh repo set-default. This repo is then used as the default remote for all gh
commands. This commit attempts to also utilize the same configuration.
This is needed because on my fork when I run Octo issue list I get the issues
from my fork and not the original repo. Now that I have set the default repo
locally, I can fetch the issues from above command.
When fetching remotes it will:
1) Fetch remotes via git remote -v
2) Apply user_defined ssh_aliases against the set
3) Fetch the local gh-resolved value
4) When returning the default remote, if a resolved value is set from step 3,
utilize that value
Describe what this PR does / why we need it
This commit adjusts the fetching remote function to also consider default repositories set by the
gh
cli. When the local git repository hasremote.origin.gh-resolved pwntester/octo.nvim
set, the resolved repository name will be used instead of the default one.When attempting to run any gh cli commands in a repo where there are multiple remotes defined, it requires the user to set the default repo to use via
gh repo set-default
. This repo is then used as the default remote for all gh commands. This commit attempts to also utilize the same configuration.This is needed because on my fork when I run
Octo issue list
I get the issues from my fork and not the original repo. Now that I have set the default repo locally, I can fetch the issues from above command.When fetching remotes it will: 1) Fetch remotes via
git remote -v
2) Apply user_defined ssh_aliases against the set 3) Fetch the localgh-resolved
value 4) When returning the default remote, if a resolved value is set from step 3, utilize that valueLet me know if theres any issues/ideas.