mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 15:36:16 -04:00
Make sure git open issue uses upstream only if exists
This commit is contained in:
parent
fdf2ce0b4d
commit
239fb4df99
5
git-open
5
git-open
|
|
@ -26,6 +26,11 @@ fi
|
|||
# assume remote origin if not provided (unless we are opening an issue, then use upstream)
|
||||
if (( is_issue )); then
|
||||
remote=${1:-"upstream"}
|
||||
giturl=$(git config --get "remote.${remote}.url")
|
||||
# @TODO ls-remote will also expand "insteadOf" items `giturl=$(git ls-remote --get-url $remote)`
|
||||
if [[ -z "$giturl" ]]; then
|
||||
remote=${1:-"origin"}
|
||||
fi
|
||||
else
|
||||
remote=${1:-"origin"}
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue