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>
maint
Fredrik Gustafsson 2011-06-09 09:47:02 +02:00 committed by Junio C Hamano
parent 2c162b56f3
commit adb231cfda
1 changed files with 9 additions and 3 deletions

View File

@ -39,9 +39,15 @@ git_broken_path_fix () {


# @@BROKEN_PATH_FIX@@ # @@BROKEN_PATH_FIX@@


die() { die () {
echo >&2 "$@" die_with_status 1 "$@"
exit 1 }

die_with_status () {
status=$1
shift
echo >&2 "$*"
exit "$status"
} }


GIT_QUIET= GIT_QUIET=