diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-01 17:21:08 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-04 12:50:17 -0400 |
commit | 59e5d92276cf0f9f0bfdd27f1cd2636d30369c13 (patch) | |
tree | fa27cec8795a4501e07f3d3151105295f9e55264 | |
parent | d0989f36d0ec5e0d3a31af6075186f182bf29e7b (diff) |
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.
-rwxr-xr-x | src/gitget/gitget | 8 |
1 files 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 |