t5520: use test_cmp_rev where possible
commitdd0f1e767b79009f5edd01d3c917f1cf186e60c9
authorDenton Liu <liu.denton@gmail.com>
Tue, 12 Nov 2019 23:08:05 +0000 (12 15:08 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Nov 2019 00:41:51 +0000 (21 09:41 +0900)
treeee36c984040177fe45faa7bacb403853308f91f0
parent979f8891cca562f0af7044ff9ade9f3e5caa3be5
t5520: use test_cmp_rev where possible

In case an invocation of `git rev-list` fails within the command
substitution, the failure will be masked. Remove the command
substitution and use test_cmp_rev() so that failures can be discovered.

This change was done with the following sed expressions:

s/test "$(git rev-parse.* \([^)]*\))" = "$(git rev-parse \([^)]*\))"/test_cmp_rev \1 \2/
s/test \([^ ]*\) = "$(git rev-parse.* \([^)]*\))"/test_cmp_rev \1 \2/
s/test "$(git rev-parse.* \([^)]*\))" != "$(git rev-parse.* \([^)]*\))"/test_cmp_rev ! \1 \2/
s/test \([^ ]*\) != "$(git rev-parse.* \([^)]*\))"/test_cmp_rev ! \1 \2/

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