t4015: avoid git as a pipe input
commit74cfa7bed96ea003e0a3ea20455096187c517b19
authorStefan Beller <sbeller@google.com>
Mon, 16 Jul 2018 23:05:36 +0000 (16 16:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Jul 2018 18:25:31 +0000 (17 11:25 -0700)
tree3d35238685139d82f0ecec782908952d2f051a24
parent21c770b63ea7ddcb6e52527d82089068b33eb9f3
t4015: avoid git as a pipe input

In t4015 we have a pattern of

    git diff [<options, related to color>] |
        grep -v "index" |
        test_decode_color >actual &&

to produce output that we want to test against. This pattern was introduced
in 86b452e2769 (diff.c: add dimming to moved line detection, 2017-06-30)
as then the focus on getting the colors right. However the pattern used
is not best practice as we do care about the exit code of Git. So let's
not have Git as the upstream of a pipe. Piping the output of grep to
some function is fine as we assume grep to be un-flawed in our test suite.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4015-diff-whitespace.sh