Make git open issue default to upstream remote

Fixes issue #95
This commit is contained in:
Tom Maenan Read Cutting 2017-10-13 16:10:44 +01:00 committed by GitHub
parent 3be1c00f36
commit fdf2ce0b4d

View file

@ -23,8 +23,12 @@ if [[ "$1" == 'issue' ]]; then
shift
fi
# assume remote origin if not provided
remote=${1:-"origin"}
# assume remote origin if not provided (unless we are opening an issue, then use upstream)
if (( is_issue )); then
remote=${1:-"upstream"}
else
remote=${1:-"origin"}
fi
# @TODO ls-remote will also expand "insteadOf" items `giturl=$(git ls-remote --get-url $remote)``
giturl=$(git config --get "remote.${remote}.url")