git p4 test: avoid loop in client_view

The printf command re-interprets the format string as
long as there are arguments to consume.  Use this to
simplify a for loop in the client_view() library function.

This requires a fix to one of the client_view callers.
An errant \n in the string was converted into a harmless
newline in the input to "p4 client -i", but now shows up
as a literal \n as passed through by "%s".  Remove the \n.

Based-on-patch-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Pete Wyckoff
2013-01-26 22:11:08 -05:00
committed by Junio C Hamano
parent daa38f4ae0
commit 6112541b44
2 changed files with 2 additions and 4 deletions

View File

@ -121,8 +121,6 @@ client_view() {
Root: $cli
View:
EOF
for arg ; do
printf "\t$arg\n"
done
printf "\t%s\n" "$@"
) | p4 client -i
}