die used to print all parameters and then exit with code 1. Now die
prints the first parameter and uses the optional second parameter as the
exit code. The default exit code is 1.
This allows scripts to control the exit code when they call die.
All current git-code only uses the first parameter of die today so this
change has no impact on them.
Signed-off-by: Fredrik Gustafsson <redacted>
Mentored-by: Jens Lehmann [off-list ref]
Mentored-by: Heiko Voigt [off-list ref]
---
git-sh-setup.sh | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index aa16b83..6aa6c59 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -40,7 +40,11 @@ git_broken_path_fix () {
# @@BROKEN_PATH_FIX@@
die() {
- echo >&2 "$@"
+ echo >&2 "$1"
+ if test $2
+ then
+ exit $2
+ fi
exit 1
}
--
1.7.5.1.219.ge2152.dirty