Browse Source

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 14 years ago committed by Junio C Hamano
parent
commit
adb231cfda
  1. 10
      git-sh-setup.sh

10
git-sh-setup.sh

@ -40,8 +40,14 @@ git_broken_path_fix () { @@ -40,8 +40,14 @@ git_broken_path_fix () {
# @@BROKEN_PATH_FIX@@

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

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

GIT_QUIET=

Loading…
Cancel
Save