interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / lib-cat-file.sh

16 lines · 400 bytes Raw Blame History
1# Library of git-cat-file related test functions.
2
3# Print a string without a trailing newline.
4echo_without_newline () {
5 printf '%s' "$*"
6}
7
8# Print a string without newlines and replace them with a NUL character (\0).
9echo_without_newline_nul () {
10 echo_without_newline "$@" | tr '\n' '\0'
11}
12
13# Calculate the length of a string.
14strlen () {
15 echo_without_newline "$1" | wc -c | sed -e 's/^ *//'
16}