]> git.ipfire.org Git - thirdparty/git.git/commit
t5801: teach compare_refs() to accept !
authorDenton Liu <liu.denton@gmail.com>
Thu, 26 Mar 2020 08:27:55 +0000 (04:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Mar 2020 17:56:40 +0000 (10:56 -0700)
commitec8f87b8eb5304c7cffa8b76838ad96850cf0e55
tree74872f856f1e54dc87f7767d35792f7078fc4308
parent3d180973c1bc0723ab4d2225e8df3469cfaa0434
t5801: teach compare_refs() to accept !

Before, testing if two refs weren't equal with compare_refs() was done
with `test_must_fail compare_refs`. This was wrong for two reasons.
First, test_must_fail should only be used on git commands. Second,
negating the error code is a little heavy-handed since in the case where
one of the git invocations within compare_refs() fails, we will report
success, even though it failed at an unexpected point.

Teach compare_refs() to accept `!` as the first argument which would
_only_ negate the test_cmp()'s return code.

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