aboutsummaryrefslogtreecommitdiffstats
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-02-27 15:22:59 -0800
committerJunio C Hamano <gitster@pobox.com>2025-02-27 15:23:00 -0800
commit9d8cce051add2eb82cb0be97a58201c1d3fe0c1b (patch)
tree656c7d9a67e9233f2b3ecdae15a3461b49af783e /t/test-lib-functions.sh
parentGit 2.49-rc0 (diff)
parentagent: advertise OS name via agent capability (diff)
downloadgit-9d8cce051add2eb82cb0be97a58201c1d3fe0c1b.tar.gz
git-9d8cce051add2eb82cb0be97a58201c1d3fe0c1b.zip
Merge branch 'ua/os-version-capability'
The value of "uname -s" is by default sent over the wire as a part of the "version" capability. * ua/os-version-capability: agent: advertise OS name via agent capability t5701: add setup test to remove side-effect dependency version: extend get_uname_info() to hide system details version: refactor get_uname_info() version: refactor redact_non_printables() version: replace manual ASCII checks with isprint() for clarity
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index b93736e0d5..79377bc0fc 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -2043,3 +2043,11 @@ test_trailing_hash () {
test-tool hexdump |
sed "s/ //g"
}
+
+# Trim and replace each character with ascii code below 32 or above
+# 127 (included) using a dot '.' character.
+# Octal intervals \001-\040 and \177-\377
+# correspond to decimal intervals 1-32 and 127-255
+test_redact_non_printables () {
+ tr -d "\n\r" | tr "[\001-\040][\177-\377]" "."
+}