aboutsummaryrefslogtreecommitdiffstats
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-08-09 10:13:14 -0700
committerJunio C Hamano <gitster@pobox.com>2019-08-09 10:13:14 -0700
commitfcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb (patch)
tree94ce8330ce50b0d87f7a5f21055675133b4d3a93 /t/test-lib-functions.sh
parentMerge branch 'rs/plug-strbuf-reak-in-read-alt-refs' (diff)
parentt0000: reword comments for "local" test (diff)
downloadgit-fcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb.tar.gz
git-fcdd9cc86d9efeb6b4bbcb9cff98d5a329afffcb.zip
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/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 48bd3b467d..e0b3f28d3a 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