From 6112541b444b52d5ac83f491eabefbf571da4997 Mon Sep 17 00:00:00 2001 From: Pete Wyckoff Date: Sat, 26 Jan 2013 22:11:08 -0500 Subject: 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 Signed-off-by: Pete Wyckoff Signed-off-by: Junio C Hamano --- t/lib-git-p4.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 't/lib-git-p4.sh') diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index 890ee6070..b1dbded3e 100644 --- a/t/lib-git-p4.sh +++ b/t/lib-git-p4.sh @@ -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 } -- cgit v1.2.1