Skip to content

Commit fcdd9cc

Browse files
committed
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
2 parents d2422a9 + 7f0b590 commit fcdd9cc

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

t/t0000-basic.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@ try_local_x () {
2525
echo "$x"
2626
}
2727

28-
# This test is an experiment to check whether any Git users are using
29-
# Shells that don't support the "local" keyword. "local" is not
28+
# Check whether the shell supports the "local" keyword. "local" is not
3029
# POSIX-standard, but it is very widely supported by POSIX-compliant
31-
# shells, and if it doesn't cause problems for people, we would like
32-
# to be able to use it in Git code.
30+
# shells, and we rely on it within Git's test framework.
3331
#
34-
# For now, this is the only test that requires "local". If your shell
35-
# fails this test, you can ignore the failure, but please report the
36-
# problem to the Git mailing list <[email protected]>, as it might
37-
# convince us to continue avoiding the use of "local".
32+
# If your shell fails this test, the results of other tests may be
33+
# unreliable. You may wish to report the problem to the Git mailing
34+
# list <[email protected]>, as it could cause us to reconsider
35+
# relying on "local".
3836
test_expect_success 'verify that the running shell supports "local"' '
3937
x="notlocal" &&
4038
echo "local" >expected1 &&

t/test-lib-functions.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,8 @@ test_oid () {
14331433
# Insert a slash into an object ID so it can be used to reference a location
14341434
# under ".git/objects". For example, "deadbeef..." becomes "de/adbeef..".
14351435
test_oid_to_path () {
1436-
echo "${1%${1#??}}/${1#??}"
1436+
local basename=${1#??}
1437+
echo "${1%$basename}/$basename"
14371438
}
14381439

14391440
# Choose a port number based on the test script's number and store it in

0 commit comments

Comments
 (0)