Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Gustafsson <iveqy@iveqy.com>2011-06-09 11:47:02 +0400
committerJunio C Hamano <gitster@pobox.com>2011-06-13 22:23:28 +0400
commitadb231cfdabd9b62c2d99519ac5f8ba29d689478 (patch)
treeb4d8ef2d6b6e5fb367800deff02899cdf624f527 /git-sh-setup.sh
parent2c162b56f370f5c33e6a945e6922d598006c5ec4 (diff)
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>
Diffstat (limited to 'git-sh-setup.sh')
-rw-r--r--git-sh-setup.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 94e26ed5e8..8e427dab31 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -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=