summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-01 17:21:08 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-04 12:50:17 -0400
commit59e5d92276cf0f9f0bfdd27f1cd2636d30369c13 (patch)
treefa27cec8795a4501e07f3d3151105295f9e55264 /src
parentd0989f36d0ec5e0d3a31af6075186f182bf29e7b (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.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gitget/gitget8
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