Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/lib-cat-file.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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. 4 echo_without_newline () { 5 printf '%s' "$*" 6 } 7 8 # Print a string without newlines and replace them with a NUL character (\0). 9 echo_without_newline_nul () { 10 echo_without_newline "$@" | tr '\n' '\0' 11 } 12 13 # Calculate the length of a string. 14 strlen () { 15 echo_without_newline "$1" | wc -c | sed -e 's/^ *//' 16 }