Make sure git open issue uses upstream only if exists

This commit is contained in:
Tom Maenan Read Cutting 2017-10-16 20:40:56 +01:00 committed by GitHub
parent fdf2ce0b4d
commit 239fb4df99

View file

@ -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