Skip to content

Commit 8648732

Browse files
drafnelgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aab9ea1 commit 8648732

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

t/test-lib.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,21 @@ do
685685
esac
686686
done
687687

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+
688703
# Fix some commands on Windows
689704
case $(uname -s) in
690705
*MINGW*)

0 commit comments

Comments
 (0)