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>
Fredrik Gustafsson committed
Jun 9, 2011 at 09:47 UTC
adb231cfdabd9b62c2d99519ac5f8ba29d689478
1 file changed
+9
-3
git-sh-setup.sh
+9
-3
@@ -39,9 +39,15 @@ git_broken_path_fix () {
39
40
# @@BROKEN_PATH_FIX@@
41
42
-die() {
43
- echo >&2 "$@"
44
- exit 1
42
+die () {
43
+ die_with_status 1 "$@"
44
+}
45
+
46
+die_with_status () {
47
+ status=$1
48
+ shift
49
+ echo >&2 "$*"
50
+ exit "$status"
51
}
52
53
GIT_QUIET=