Skip to content

Commit

Permalink
t/test-lib.sh: provide a shell implementation of the 'yes' utility
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Aug 28, 2009
1 parent aab9ea1 commit 8648732
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,21 @@ do
esac
done

# Provide an implementation of the 'yes' utility
yes () {
if test $# = 0
then
y=y
else
y="$*"
fi

while echo "$y"
do
:
done
}

# Fix some commands on Windows
case $(uname -s) in
*MINGW*)
Expand Down

0 comments on commit 8648732

Please sign in to comment.