Merge branch 'js/test-lib-windows-emulated-yes'
authorJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2016 22:20:10 +0000 (14:20 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Feb 2016 22:20:10 +0000 (14:20 -0800)
The emulated "yes" command used in our test scripts has been
tweaked not to spend too much time generating unnecessary output
that is not used, to help those who test on Windows where it would
not stop until it fills the pipe buffer due to lack of SIGPIPE.

* js/test-lib-windows-emulated-yes:
test-lib: limit the output of the yes utility

t/test-lib.sh
index bd4b02e9dbf9560cf1285bb6607be83964ecc40a..51e4a88c333463e23957eb07139b01a3de1a1a0e 100644 (file)
@@ -907,9 +907,11 @@ yes () {
                y="$*"
        fi
 
-       while echo "$y"
+       i=0
+       while test $i -lt 99
        do
-               :
+               echo "$y"
+               i=$(($i+1))
        done
 }