submodule tests: test for a "foreach" blind-spot

We tested for "--" followed by command names, but not for "--" followed by an argument that looks like an option, let's do that. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>

Ævar Arnfjörð Bjarmason committed Nov 8, 2022 at 15:10 UTC d50d8485ef03898a4f51fd99daa65217f2b713ae
1 file changed +5
t/t7407-submodule-foreach.sh
+5
@@ -154,6 +154,11 @@ test_expect_success 'use "submodule foreach" to checkout 2nd level submodule' '
154 )
155 '
156
157 +test_expect_success 'usage: foreach -- --not-an-option' '
158 + test_expect_code 1 git submodule foreach -- --not-an-option &&
159 + test_expect_code 1 git -C clone2 submodule foreach -- --not-an-option
160 +'
161 +
162 test_expect_success 'use "foreach --recursive" to checkout all submodules' '
163 (
164 cd clone2 &&