When specifying a repository for `gh repo set-default`, users can now
use a git remote name (e.g., "origin", "upstream") instead of the
full OWNER/REPO format.
The command first checks if the argument is a git remote name. If
found, it uses the corresponding repository. Otherwise, it falls
back to parsing the argument as OWNER/REPO format.
Example:
gh repo set-default origin
Fixes#9149
Signed-off-by: majiayu000 <1835304752@qq.com>
Change logging of `gh repo set-default --view` to `stderr` when no default exists to better conform with expectations and unix standards.
---------
Signed-off-by: Prabhat <iprabhatdev@gmail.com>
The command was using this to check for git repo context:
git rev-parse --is-inside-work-tree
With this change, this is used instead:
git rev-parse --git-dir
The latter approach works in the context of a bare git repository, which does not have a worktree.