t1092: clean up script quoting

This test was introduced in 19a0acc83e4 (t1092: test interesting sparse-checkout scenarios, 2021-01-23), but it contains issues with quoting that were not noticed until starting this follow-up series. The old mechanism would drop quoting such as in test_all_match git commit -m "touch README.md" The above happened to work because README.md is a file in the repository, so 'git commit -m touch REAMDE.md' would succeed by accident. Other cases included quoting for no good reason, so clean that up now. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Mar 30, 2021 at 13:10 UTC 4b3f765a2f38064c0bb221c76c7bb4f28f94a9dc
1 file changed +10 -10
t/t1092-sparse-checkout-compatibility.sh
+10 -10
@@ -96,20 +96,20 @@ init_repos () {
96 run_on_sparse () {
97 (
98 cd sparse-checkout &&
99 - $* >../sparse-checkout-out 2>../sparse-checkout-err
99 + "$@" >../sparse-checkout-out 2>../sparse-checkout-err
100 )
101 }
102
103 run_on_all () {
104 (
105 cd full-checkout &&
106 - $* >../full-checkout-out 2>../full-checkout-err
106 + "$@" >../full-checkout-out 2>../full-checkout-err
107 ) &&
108 - run_on_sparse $*
108 + run_on_sparse "$@"
109 }
110
111 test_all_match () {
112 - run_on_all $* &&
112 + run_on_all "$@" &&
113 test_cmp full-checkout-out sparse-checkout-out &&
114 test_cmp full-checkout-err sparse-checkout-err
115 }
@@ -119,7 +119,7 @@ test_expect_success 'status with options' '
119 test_all_match git status --porcelain=v2 &&
120 test_all_match git status --porcelain=v2 -z -u &&
121 test_all_match git status --porcelain=v2 -uno &&
122 - run_on_all "touch README.md" &&
122 + run_on_all touch README.md &&
123 test_all_match git status --porcelain=v2 &&
124 test_all_match git status --porcelain=v2 -z -u &&
125 test_all_match git status --porcelain=v2 -uno &&
@@ -135,7 +135,7 @@ test_expect_success 'add, commit, checkout' '
135 write_script edit-contents <<-\EOF &&
136 echo text >>$1
137 EOF
138 - run_on_all "../edit-contents README.md" &&
138 + run_on_all ../edit-contents README.md &&
139
140 test_all_match git add README.md &&
141 test_all_match git status --porcelain=v2 &&
@@ -144,7 +144,7 @@ test_expect_success 'add, commit, checkout' '
144 test_all_match git checkout HEAD~1 &&
145 test_all_match git checkout - &&
146
147 - run_on_all "../edit-contents README.md" &&
147 + run_on_all ../edit-contents README.md &&
148
149 test_all_match git add -A &&
150 test_all_match git status --porcelain=v2 &&
@@ -153,7 +153,7 @@ test_expect_success 'add, commit, checkout' '
153 test_all_match git checkout HEAD~1 &&
154 test_all_match git checkout - &&
155
156 - run_on_all "../edit-contents deep/newfile" &&
156 + run_on_all ../edit-contents deep/newfile &&
157
158 test_all_match git status --porcelain=v2 -uno &&
159 test_all_match git status --porcelain=v2 &&
@@ -186,7 +186,7 @@ test_expect_success 'diff --staged' '
186 write_script edit-contents <<-\EOF &&
187 echo text >>README.md
188 EOF
189 - run_on_all "../edit-contents" &&
189 + run_on_all ../edit-contents &&
190
191 test_all_match git diff &&
192 test_all_match git diff --staged &&
@@ -280,7 +280,7 @@ test_expect_success 'clean' '
280 echo bogus >>.gitignore &&
281 run_on_all cp ../.gitignore . &&
282 test_all_match git add .gitignore &&
283 - test_all_match git commit -m ignore-bogus-files &&
283 + test_all_match git commit -m "ignore bogus files" &&
284
285 run_on_sparse mkdir folder1 &&
286 run_on_all touch folder1/bogus &&