DORMANTno replies

[PATCH] t1507: change quoting in test_did_you_mean to a more general one

From: Kacper Kornet <hidden>
Date: 2016-06-15 22:51:10
Subsystem: the rest · Maintainer: Linus Torvalds

In bash and some other shells the script:

x=2; unset a; echo "${a:-'$x'}"

prints '2'. However ksh shell prints $x. The quoting is added to
reproduce bash behaviour.

Signed-off-by: Kacper Kornet <redacted>
---
 t/t1506-rev-parse-diagnosis.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 4a6396f..bad09f9 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -8,8 +8,8 @@ exec </dev/null
 
 test_did_you_mean ()
 {
-	printf "fatal: Path '$2$3' $4, but not ${5:-'$3'}.\n" >expected &&
-	printf "Did you mean '$1:$2$3'${2:+ aka '$1:./$3'}?\n" >>expected &&
+	printf "fatal: Path '$2$3' $4, but not ${5:-\'$3\'}.\n" >expected &&
+	printf "Did you mean '$1:$2$3'${2:+ aka \'$1:./$3\'}?\n" >>expected &&
 	test_cmp expected error
 }
 
-- 
1.7.5

-- 
  Kacper Kornet
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help