From: Fredrik Gustafsson Date: Thu, 9 Jun 2011 07:47:02 +0000 (+0200) Subject: git-sh-setup: add die_with_status X-Git-Tag: v1.7.7-rc0~107^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=adb231cfdabd9b62c2d99519ac5f8ba29d689478;p=git.git git-sh-setup: add die_with_status This behaves similar to "die" but can exit with status different from the usual 1. Signed-off-by: Fredrik Gustafsson Mentored-by: Jens Lehmann Mentored-by: Heiko Voigt Signed-off-by: Junio C Hamano --- diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 94e26ed5e..8e427dab3 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -39,9 +39,15 @@ git_broken_path_fix () { # @@BROKEN_PATH_FIX@@ -die() { - echo >&2 "$@" - exit 1 +die () { + die_with_status 1 "$@" +} + +die_with_status () { + status=$1 + shift + echo >&2 "$*" + exit "$status" } GIT_QUIET=