summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-08-09 17:13:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-09 17:13:14 (GMT)
commitfcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb (patch)
tree94ce8330ce50b0d87f7a5f21055675133b4d3a93 /t
parentd2422a99ccce96c9618357827c84bad6110dee4a (diff)
parent7f0b5908759c59b77b39c62184166325e30f8878 (diff)
downloadgit-fcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb.zip
git-fcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb.tar.gz
git-fcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb.tar.bz2
Merge branch 'bc/hash-independent-tests-part-4'
Test fix. * bc/hash-independent-tests-part-4: t0000: reword comments for "local" test t: decrease nesting in test_oid_to_path
Diffstat (limited to 't')
-rwxr-xr-xt/t0000-basic.sh14
-rw-r--r--t/test-lib-functions.sh3
2 files changed, 8 insertions, 9 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index e89438e..9ca0818 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -25,16 +25,14 @@ try_local_x () {
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
+# Check whether the shell supports 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.
+# shells, and we rely on it within Git's test framework.
#
-# 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".
+# If your shell fails this test, the results of other tests may be
+# unreliable. You may wish to report the problem to the Git mailing
+# list <git@vger.kernel.org>, as it could cause us to reconsider
+# relying on "local".
test_expect_success 'verify that the running shell supports "local"' '
x="notlocal" &&
echo "local" >expected1 &&
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 48bd3b4..e0b3f28 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -1433,7 +1433,8 @@ test_oid () {
# Insert a slash into an object ID so it can be used to reference a location
# under ".git/objects". For example, "deadbeef..." becomes "de/adbeef..".
test_oid_to_path () {
- echo "${1%${1#??}}/${1#??}"
+ local basename=${1#??}
+ echo "${1%$basename}/$basename"
}
# Choose a port number based on the test script's number and store it in