Skip to content

Commit adb231c

Browse files
iveqygitster
authored andcommitted
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 <[email protected]> Mentored-by: Jens Lehmann <[email protected]> Mentored-by: Heiko Voigt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c162b5 commit adb231c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

git-sh-setup.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@ git_broken_path_fix () {
3939
4040
# @@BROKEN_PATH_FIX@@
4141
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"
4551
}
4652
4753
GIT_QUIET=

0 commit comments

Comments
 (0)