From adb231cfdabd9b62c2d99519ac5f8ba29d689478 Mon Sep 17 00:00:00 2001 From: Fredrik Gustafsson Date: Thu, 9 Jun 2011 09:47:02 +0200 Subject: 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 94e26ed..8e427da 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= -- cgit v0.10.2-6-g49f6