diff options
author | Fredrik Gustafsson <iveqy@iveqy.com> | 2011-06-09 09:47:02 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-06-13 11:23:28 -0700 |
commit | adb231cfdabd9b62c2d99519ac5f8ba29d689478 (patch) | |
tree | b4d8ef2d6b6e5fb367800deff02899cdf624f527 | |
parent | 2c162b56f370f5c33e6a945e6922d598006c5ec4 (diff) | |
download | git-adb231cfdabd9b62c2d99519ac5f8ba29d689478.tar.gz |
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 <iveqy@iveqy.com>
Mentored-by: Jens Lehmann <Jens.Lehmann@web.de>
Mentored-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | git-sh-setup.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 94e26ed5e8..8e427dab31 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= |