t: move 'hex2oct' into test-lib-functions.sh
authorTaylor Blau <me@ttaylorr.com>
Fri, 5 Apr 2019 03:37:42 +0000 (20:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Apr 2019 06:06:04 +0000 (15:06 +0900)
The helper 'hex2oct' is used to convert base-16 encoded data into a
base-8 binary form, and is useful for preparing data for commands that
accept input in a binary format, such as 'git hash-object', via
'printf'.

This helper is defined identically in three separate places throughout
't'. Move the definition to test-lib-function.sh, so that it can be used
in new test suites, and its definition is not redundant.

This will likewise make our job easier in the subsequent commit, which
also uses 'hex2oct'.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found