Skip to content

Commit

Permalink
git-sh-setup: add die_with_status
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fredrik Gustafsson authored and Junio C Hamano committed Jun 13, 2011
1 parent 2c162b5 commit adb231c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions git-sh-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit adb231c

Please sign in to comment.