t5520: replace test -{n,z} with test-lib functions
commit979f8891cca562f0af7044ff9ade9f3e5caa3be5
authorDenton Liu <liu.denton@gmail.com>
Tue, 12 Nov 2019 23:08:02 +0000 (12 15:08 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Nov 2019 00:41:51 +0000 (21 09:41 +0900)
treed1278d31365442e516c8274bd54a95a8c29fbb7d
parent3037d3db90c994cb3e5913a54f83acdefc219174
t5520: replace test -{n,z} with test-lib functions

When wrapping a git command in a command substitution within another
command, we throw away the git command's exit code. In case the git
command fails, we would like to know about it rather than the failure
being silent. Extract git commands so that their exit codes are not
lost.

Instead of using `test -n` or `test -z`, replace them respectively with
invocations of test_file_not_empty() and test_must_be_empty() so that we
get better debugging information in the case of a failure.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5520-pull.sh