@matheusbsbs / matheus-bagliano / commits / 8648732e29
Fork 0

t/test-lib.sh: provide a shell implementation of the 'yes' utility

Some platforms (IRIX 6.5, Solaris 7) do not provide the 'yes' utility. Currently, some tests, including t7610 and t9001, try to call this program. Due to the way the tests are structured, the tests still pass even though this program is missing. Rather than succeeding by chance, let's provide an implementation of the simple 'yes' utility in shell for all platforms to use. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Casey committed Aug 28, 2009 at 17:32 UTC 8648732e298b74b25171c97e6ea144818f29c403
1 file changed +15
t/test-lib.sh
+15
@@ -685,6 +685,21 @@ do
685 esac
686 done
687
688 +# Provide an implementation of the 'yes' utility
689 +yes () {
690 + if test $# = 0
691 + then
692 + y=y
693 + else
694 + y="$*"
695 + fi
696 +
697 + while echo "$y"
698 + do
699 + :
700 + done
701 +}
702 +
703 # Fix some commands on Windows
704 case $(uname -s) in
705 *MINGW*)