diff options
author | Elijah Newren <newren@gmail.com> | 2010-10-03 14:00:14 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-10-06 13:26:33 -0700 |
commit | 00648ba0505bbe1999bb6ae2f1d02a0ef923b191 (patch) | |
tree | a6bd5229da9fd44b8f29be12cb900d3ef8500868 /t/test-lib.sh | |
parent | bc0f35ca238ff88829cd9839641a316e859348a2 (diff) | |
download | git-00648ba0505bbe1999bb6ae2f1d02a0ef923b191.tar.gz |
Introduce sane_unset and use it to ensure proper && chaining
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index d86edcd7a6..87308f5a9b 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -268,6 +268,17 @@ remove_cr () { tr '\015' Q | sed -e 's/Q$//' } +# In some bourne shell implementations, the "unset" builtin returns +# nonzero status when a variable to be unset was not set in the first +# place. +# +# Use sane_unset when that should not be considered an error. + +sane_unset () { + unset "$@" + return 0 +} + test_tick () { if test -z "${test_tick+set}" then |