From 009264f9cc537946a19aa7319fd149842d98d82b Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Wed, 23 Jan 2013 19:58:55 +0000 Subject: [PATCH] Correctly forward error code when git pull fails in crup-runner.sh The old code would always exit 0, because it returned the exit status of the if command BUG=none TEST=try to run git crup in src/ with unstaged changes. Should bail out and not run hooks R=szager@chromium.org Review URL: https://chromiumcodereview.appspot.com/12040046 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@178356 0039d316-1c4b-4281-b951-d872f2087c98 --- crup-runner.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crup-runner.sh b/crup-runner.sh index b82206727..65fec79bf 100755 --- a/crup-runner.sh +++ b/crup-runner.sh @@ -79,8 +79,9 @@ if [ "$solution" = "$1" ]; then fi shift 2 $first_args $@ | sed "s/^/[$solution] /g" 1>&2 - if [ $? -ne 0 ]; then - exit $? + status=$? + if [ "$status" -ne 0 ]; then + exit $status fi set_target_os