@@ -1016,11 +1016,13 @@ test_must_be_empty () {
# provided first, that its other two parameters refer to different
# revisions.
test_cmp_rev () {
- local op
+ local op wrong_result
op='='
+ wrong_result='different'
if test $# -ge 1 && test "x$1" = 'x!'
then
op='!='
+ wrong_result='the same'
shift
fi
if test $# != 2
@@ -1033,15 +1035,8 @@ test_cmp_rev () {
if ! test "$r1" "$op" "$r2"
then
- local comp_out
- if "x$op" = 'x='
- then
- comp_out='different'
- else
- comp_out='the same'
- fi
cat >&4 <<-EOF
- error: two revisions point to $comp_out objects:
+ error: two revisions point to $wrong_result objects:
'$1': $r1
'$2': $r2
EOF
Signed-off-by: Denton Liu <liu.denton@gmail.com> --- Thanks for the suggestion, Junio. Since it's just a minor cleanup, here's the fixup patch for it. t/test-lib-functions.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)