]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/test-lib-functions.sh
Merge branch 'bb/unicode-12.1-reiwa' into maint
[thirdparty/git.git] / t / test-lib-functions.sh
index 788ea1f18b99c5edacd9ae0ee81310141c799c6e..8270de74beafb931f09f296557406c0d158d48de 100644 (file)
@@ -1239,6 +1239,12 @@ depacketize () {
        '
 }
 
+# Converts base-16 data into base-8. The output is given as a sequence of
+# escaped octals, suitable for consumption by 'printf'.
+hex2oct () {
+       perl -ne 'printf "\\%03o", hex for /../g'
+}
+
 # Set the hash algorithm in use to $1.  Only useful when testing the testsuite.
 test_set_hash () {
        test_hash_algo="$1"