aboutsummaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorMarkus Heidelberg <markus.heidelberg@web.de>2009-01-20 00:43:26 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-19 22:39:31 -0800
commit35641310afa04aaa0ba5f31be6bdb2cf23ec100f (patch)
treeb7c91041d8a6c9ba0bd625b25dbbb3aecd5fb193 /t/test-lib.sh
parentbc08fc4e850794c76da367bb628e508e6d41b1eb (diff)
downloadgit-35641310afa04aaa0ba5f31be6bdb2cf23ec100f.tar.gz
git-35641310afa04aaa0ba5f31be6bdb2cf23ec100f.tar.xz
use uppercase POSIX compliant signals for the 'trap' command
In 'man 1p trap' there is written: "Implementations may permit names with the SIG prefix or ignore case in signal names as an extension." So change the lowercase signals to uppercase, which is POSIX compliant instead of being an extension. There wasn't anybody claiming that it doesn't work, but there was a bug with using a signal with the SIG prefix, which is an extension as well. So let's play it safe and change it, since it doesn't hurt anyone. While at it, also convert 8 indentation spaces to 1 tab character. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 22ed448d5..41d5a5996 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -127,7 +127,7 @@ fi
error () {
say_color error "error: $*"
- trap - exit
+ trap - EXIT
exit 1
}
@@ -163,7 +163,7 @@ die () {
exit 1
}
-trap 'die' exit
+trap 'die' EXIT
# The semantics of the editor variables are that of invoking
# sh -c "$EDITOR \"$@\"" files ...
@@ -208,7 +208,7 @@ test_failure_ () {
say_color error "FAIL $test_count: $1"
shift
echo "$@" | sed -e 's/^/ /'
- test "$immediate" = "" || { trap - exit; exit 1; }
+ test "$immediate" = "" || { trap - EXIT; exit 1; }
}
test_known_broken_ok_ () {
@@ -416,7 +416,7 @@ test_create_repo () {
}
test_done () {
- trap - exit
+ trap - EXIT
test_results_dir="$TEST_DIRECTORY/test-results"
mkdir -p "$test_results_dir"
test_results_path="$test_results_dir/${0%-*}-$$"
@@ -493,7 +493,7 @@ fi
test="trash directory.$(basename "$0" .sh)"
test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
rm -fr "$test" || {
- trap - exit
+ trap - EXIT
echo >&5 "FATAL: Cannot prepare test area"
exit 1
}