From 59e5d92276cf0f9f0bfdd27f1cd2636d30369c13 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 1 May 2017 17:21:08 -0400 Subject: bugfix: gitget: correctly detect `git config` error There's no test for this because the ultimate behavior is the same; the bug is in deciding *which* error message to print. --- src/gitget/gitget | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gitget/gitget b/src/gitget/gitget index 7bdb9c9..7a0f0bf 100755 --- a/src/gitget/gitget +++ b/src/gitget/gitget @@ -74,8 +74,8 @@ download_git_checkout() { if $FORCE; then git config remote.origin.pushUrl "$push" else - local curpush="$(git config --get remote.origin.pushUrl)" - if [[ $? != 0 ]] ; then + local curpush + if ! curpush="$(git config --get remote.origin.pushUrl)"; then error "%s does not have a %s configured" pushUrl "$name" plain "Aborting..." exit 1 @@ -128,8 +128,8 @@ download_git_bare() { if $FORCE; then git config remote.origin.pushUrl "$push" else - local curpush="$(git config --get remote.origin.pushUrl)" - if [[ $? != 0 ]] ; then + local curpush + if ! curpush="$(git config --get remote.origin.pushUrl)"; then error "%s does not have a %s configured" pushUrl "$name" plain "Aborting..." exit 1 -- cgit v1.2.2