]> git.ipfire.org Git - thirdparty/git.git/commit - t/t4124-apply-ws-rule.sh
t4124: tweak test so that non-compliant diff(1) can also be used
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>
Thu, 26 Mar 2020 04:37:37 +0000 (11:37 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Mar 2020 00:19:14 +0000 (17:19 -0700)
commitf73533aa38e5a8f3e56d1cc7d31852b0710b3e39
tree6e4efd43016605e3245563e192d71d99a467223b
parentd51dd4ca3ad12d2d4153418cf13027390748a914
t4124: tweak test so that non-compliant diff(1) can also be used

The diff(1) implementation of busybox produces the unified context
format even without being asked, and it cannot produce the default
format, but a test in this script relies on.

We could rewrite the test so that we count the lines in the
postimage out of the unified context format, but the format is not
supported by some implementations of diff (e.g. HP-UX).

Accomodate busybox by adding a fallback code to count postimage
lines in unified context output, when counting in the output in the
default format finds nothing.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
[jc: applied Documentation/CodingGuidelines and tweaked the log message]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4124-apply-ws-rule.sh