tests: avoid nonportable {foo,bar} glob
Unlike bash and ksh, dash and busybox ash do not support brace expansion (as in 'echo {hello,world}'). So when dash is sh, t6009.13 (set up dodecapus) ends up pass a string beginning with "root{1,2," to "git merge" verbatim and the test fails. Fix it by introducing a variable to hold the list of parents for the dodecapus and populating it in a more low-tech way. While at it, simplify a little by combining this setup code with the test it sets up for. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Mar 24, 2011 at 03:21 UTC
482ce70e14fdd5d03304a92f1740e6a9022e7958
1 file changed
+8
-8
t/t6009-rev-list-parent.sh
+8
-8
@@ -112,20 +112,20 @@ test_expect_success 'rev-list override and infinities' '
112
check_revlist "--max-parents=0 --min-parents=1 --no-min-parents" one five
113
'
114
115
-test_expect_success 'set up dodecapus' '
115
+test_expect_success 'dodecapus' '
116
117
+ roots= &&
118
for i in 1 2 3 4 5 6 7 8 9 10 11
119
do
119
- git checkout -b root$i five || return
120
- test_commit $i || return
120
+ git checkout -b root$i five &&
121
+ test_commit $i &&
122
+ roots="$roots root$i" ||
123
+ return
124
done &&
125
git checkout master &&
126
test_tick &&
124
- git merge -m dodecapus root{1,2,3,4,5,6,7,8,9,10,11} &&
125
- git tag dodecapus
126
-'
127
-
128
-test_expect_success 'test with dodecapus' '
127
+ git merge -m dodecapus $roots &&
128
+ git tag dodecapus &&
129
130
check_revlist "--min-parents=4" dodecapus tetrapus &&
131
check_revlist "--min-parents=8" dodecapus &&