test: refactor to use "get_abbrev_oid" to get abbrev oid
commit12d6991cf417465d567c38ba8ae7d59bda7a202f
authorJiang Xin <worldhello.net@gmail.com>
Thu, 17 Jun 2021 03:17:27 +0000 (17 11:17 +0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Jun 2021 05:12:24 +0000 (17 14:12 +0900)
tree9474d49f346d2db497f1bc2b95dacaf61b69128a
parent3c06a583398f6630c7162b463ff1acbdf0110f83
test: refactor to use "get_abbrev_oid" to get abbrev oid

Add new function "get_abbrev_oid" to get abbrev object ID.  This
function has a default value which helps to prepare a nonempty replace
pattern for sed command.  An empty replace pattern may cause sed fail
to allocate memory.

Refactor function "make_user_friendly_and_stable_output" to use
"get_abbrev_oid" to get abbrev object ID.

Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 files changed:
t/t5411/common-functions.sh
t/t5411/test-0000-standard-git-push.sh
t/t5411/test-0001-standard-git-push--porcelain.sh
t/t5411/test-0022-report-unexpect-ref.sh
t/t5411/test-0023-report-unexpect-ref--porcelain.sh
t/t5411/test-0032-report-with-options.sh
t/t5411/test-0033-report-with-options--porcelain.sh
t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
t/t5411/test-0038-report-mixed-refs.sh
t/t5411/test-0039-report-mixed-refs--porcelain.sh
t/t5411/test-0040-process-all-refs.sh
t/t5411/test-0041-process-all-refs--porcelain.sh
t/t5411/test-0050-proc-receive-refs-with-modifiers.sh
t/t5548-push-porcelain.sh