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>
This commit is contained in:
Fredrik Gustafsson 2011-06-09 09:47:02 +02:00 committed by Junio C Hamano
parent 2c162b56f3
commit adb231cfda

View file

@ -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=