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:
authorJunio C Hamano <gitster@pobox.com>2017-11-06 07:11:26 +0300
committerJunio C Hamano <gitster@pobox.com>2017-11-06 07:11:26 +0300
commit51bb4d62a06b0313dd3e4610da8af1bbf9497894 (patch)
tree2061a59bce34d6eb4f5bad2c2b7ae8523bad9e29
parentda7996aaf75fcd58c0fb787c15ee9569140a2f9c (diff)
parent01d3a526ad9a37938f3597b2c160d699904cb8b8 (diff)
Merge branch 'mh/test-local-canary'
We try to see if somebody runs our test suite with a shell that does not support "local" like bash/dash does. * mh/test-local-canary: t0000: check whether the shell supports the "local" keyword
-rwxr-xr-xt/t0000-basic.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 1aa5093f36..7fd87dd544 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -20,6 +20,31 @@ modification *should* take notice and update the test vectors here.
. ./test-lib.sh
+try_local_x () {
+ local x="local" &&
+ echo "$x"
+}
+
+# This test is an experiment to check whether any Git users are using
+# Shells that don't support the "local" keyword. "local" is not
+# POSIX-standard, but it is very widely supported by POSIX-compliant
+# shells, and if it doesn't cause problems for people, we would like
+# to be able to use it in Git code.
+#
+# For now, this is the only test that requires "local". If your shell
+# fails this test, you can ignore the failure, but please report the
+# problem to the Git mailing list <git@vger.kernel.org>, as it might
+# convince us to continue avoiding the use of "local".
+test_expect_success 'verify that the running shell supports "local"' '
+ x="notlocal" &&
+ echo "local" >expected1 &&
+ try_local_x >actual1 &&
+ test_cmp expected1 actual1 &&
+ echo "notlocal" >expected2 &&
+ echo "$x" >actual2 &&
+ test_cmp expected2 actual2
+'
+
################################################################
# git init has been done in an empty repository.
# make sure it is empty.