From fdf2ce0b4dc90be32dd8bc3779513915421b9d65 Mon Sep 17 00:00:00 2001 From: Tom Maenan Read Cutting Date: Fri, 13 Oct 2017 16:10:44 +0100 Subject: [PATCH] Make `git open issue` default to upstream remote Fixes issue #95 --- git-open | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/git-open b/git-open index 6320f26..ac6bad0 100755 --- a/git-open +++ b/git-open @@ -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")