summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/test-lib-functions.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 0367cec5fd..7860491660 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -1334,6 +1334,12 @@ test_oid () {
eval "printf '%s' \"\${$var}\""
}
+# 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#??}"
+}
+
# Choose a port number based on the test script's number and store it in
# the given variable name, unless that variable already contains a number.
test_set_port () {